• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Open PDF file by AJAX holding the button

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can you help me with the following problem?

I have a form where you select the parameters to generate a PDF report that will be returned by a Struts 1.x action that will be opened by the browser. This is working perfectly synchronously in the system.

But what I need to protect the system from the user is requesting the report without having done all the time, putting a lock on the button to be enabled only once the report was generated.

My choice was to create a function in AJAX (asynchronous call) to which this report was generated, and while this process does not answer me back I hide the button and show the "loading" and so has the return button I show and hide the "loading".

But I'm having problems in two different trials:

In the first attempt (code 1) with jQuery behavior of the button and the loading are expected but my PDF file that returns the function (data) below does not open in browser download window:



On the second try (code 2) using Dojo return the PDF file is expected but when the browser's download window opens lose control in order to enable the button again and disable image loading.


Is there any way to open this PDF file using jQuery or Dojo in control my DIVs?


Thank you,


HTML Fragment:



Code 1 (jQuery):



Code 2 (Dojo):



 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic