Show message and download at same time

Show message and download at same time

  
I have a Jquery Modal Dialog that open a pop up with a message that I normal use to show messages. But now i want to show a message and download a file. For some reason that I don't know when I do this the pop-up doesn't show. I tried to put the download in other screen action using widget click. But when i do this the zip file is download with error and empty.

Any ideias how to solve this?

Thanks in advance
Hi Marcelo,

I don't think I got right what you mean. But if you show a message on this popup why don't you include a link for the download? Do you want the download to start automatically when the popup is opened? Why not give the choice to the user to click a link to download the file....

Cheers,
You can have an Ajax action and a different link for downloading the file (the link can be hidden).

On your ajax action you show the feedback message and then widget_click (this is a Richwidgets Action) the link to download.

This way you should see the message and download the file.
Here is a example of what i'm trying to do.
I'm even more confused. You want to download the uploaded file?...

The issue you have with the download in Ok action is that you're using the set message on the same flow that ends with a download. The download widget doesn't send the request as html, so the page is not rendered again. It sends the binary content of the file.

You also can't have a link to a download with an Ajax Submit method... Try and replace the link method or even replace it with a button instead...

I hope this helps.
Cheers 
The upload was the fastest way of simulate having a file binary. I will try your suggestions.

Thanks
Hello Andre, 
                  I am trying to accomplish the same. So the first download button is a submit button. In its click action, after the feedback message, I have added a run javascript, which is clicking another button(also submit becuase of download) and I am trying to download the file in this click action. This works with IE11 but in fire-fox and chrome it throws an error message  "An Exception occurred in the client Script. Error: The Connection to the server was reset". I checked the network tools and it is showing that request was cancelled. What could be causing it ? 

Thanks

André Vieira wrote:
I'm even more confused. You want to download the uploaded file?...

The issue you have with the download in Ok action is that you're using the set message on the same flow that ends with a download. The download widget doesn't send the request as html, so the page is not rendered again. It sends the binary content of the file.

You also can't have a link to a download with an Ajax Submit method... Try and replace the link method or even replace it with a button instead...

I hope this helps.
Cheers 
 
 
Hello kota,

Why does you first button have to be submit. Both the Feedback and the Javascript actions don't require that the action is a submit. Try to change the first button to Ajax Submit.
I tried to change first button to ajax and it was acting weirdly. Sometime it will throw the  "An Exception occurred in the client Script. Error: The Connection to the server was reset" error and download the file. Other times it will download not the actual file but the aspx page with no content and it was queuing the feebback message blocks , when I go to some other page it will show all of them is quick succession. I got it to work with set timeout for second buttong click, so now it waits for first ajax request to finish and then click the second button. This seems to be working but I want to use more sophisticated approach. Is there an event to check if the feedback message has been successfully shown on the page something like ajaxSuccess ? I would like to use that event to initiate clicking of second buttong rather than relying on some hard coded time in set timeout function.