Download PDF after Ajax refresh

Download PDF after Ajax refresh

  
Hi, 

I cannot seems to download PDF after AJAX refresh. 

My app takes the following steps:
1. Wizard in the form of Popup editor
2. When user complete the necessary steps, the following sequence of event should occur:
   a. Popup send User ID in a message triggered by Popup_Editor_Notify
   b. Popup close
   c. User list is "AJAX"ed refreshed in the calling (parent) screen
   d. PDF is generated (using passed User ID) and download

Works great until the last step. This is quite obvious cause chain of events which triggers AJAX refresh, should end up in the client and not ask the server for the generated PDF...

I've try to work around it by adding a hidden buttom in the host screen. This button has the functionalilty of generating and downloading the PDF. The button is being called by the Ajax refresh action in the hosting screen. This, however does not work.

B.T.W - For the PDF generation,  im using URLToPDF extension. 

Any creative idea how i can solve this?

Dror

Hi Dror,
 
To call the generate pdf functionality , I'm using the widget_click action, that click on a button, this button is inside a DIV, the DIV has the style invisible, not the button. I tested and works. Take a look on the eSpace.
 
Regards,
Nelson Baptista
Nelson, 

First of all - Thanks for your app.

Your code - works fine, even though the PDF seems not sharp enough. After implementing your suggestion, my code still does not work. For some reason, the 'Widget_Click' does not trigger the screen action. Any idea?


Best regards, 


Dror
Hi Dror,

If you can provide the oml it will be easier to check if something is wrong.

When applying  Nelson's solution don't forget that you need a container with display false arround the button. don´t put the button with visible set to false.

Best Regards

Carlos Rocha
Hi, 

Attached is the "Problematic" OML. What am I missing?

Best regards, 

Dror
Hi Dror, 
 
I didn't tested because there is some references to other eSpaces. But I saw the possible cause of the problem, you have the button with the property visible=false, If you set it to visible = true, it will solve.




Let us know if is working,
Regards,
Nelson Baptista