I have a button which downloads a file so the button has to be a submit. However, I want to have a feedback_message in the action to let the person know the report is complete. It seems like with the button set to submit the feedback_message never displays.
Jason Herrington wrote:
Hi Jason Herrington,
The download prevents the Feedback_Message from being displayed in the screen.. Even if it's called first.
So you can try with another method.,
Create a button with the following action.
In the widget click give the id of the button which is having the download function and make the extended properties to
Regards,
Ellakkiya
Ellakkiya Selvadurai wrote:
Ellakkiya - that worked! I did modify it slightly as I wanted it to run and create the report THEN notify the person that the report was complete but its working now.
Quick correction to this - and this is a bit sub optimal but as you said it seems to be the only way to get it to work. If you do the first button click (the one the user sees) as a submit, even if you do widget click in it on a hidden button with ajax submit set to it and the feedback in there - it still doesn't let the feedback be shown. So, the initial button you do that the user sees has to be set to ajax submit. In my case, they are running a report that may take several minutes, so I don't want the feedback to be shown until the report is complete. So what I had to do was have the initial button actually make the report, save it to a local variable, do the feedback, then do a widget click on the hidden button that has type set to submit and then in that action it just downloads the local file. So I think I am passing that report back and forth a few more times that I really should be between the server and the client, which will slow this down a bit, but this seems to be the only way to have a download and a feedback AND show the feedback message AFTER the report has been completed. If I didn't care about that last part I could have the first action (the visible button click) be ajax submit, show the feedback and then do the widget click - then in the submit action create the report and download it immediately which I think would be a bit faster.
Thankyou for explaining.
Can you share a snap of Button-OnClick Action
assif_tiger wrote:
Hi,
You might be confusing the Feedback_Message action with the Feedback_Message widget.
Here's the Feedback_Message action, which obviously you are using on your application:
Here's the Feedback_Message widget, which is a web block also found in the RichWidgets module:
For the action to work, the screen must include the widget. This is usually included in the Layout web block, so you don't need to think about it. But if you create your own theme, or create a screen that uses a different layout block, you might easily forget this dependency.
Try adding this widget to the end of your screen, or to the layout web block that it uses. If you continue facing the same problem, please attach your module so we can help you more effectively.
Cheers
I have never had to use that widget. I made a new button which I set with ajax submit, made an action with the feedback_message action and it works fine. I think what is causing it not to work is that the buttons for the action I stated above have to be submit as I am downloading a file at the end of the action. It seems like submit makes feedback_message not work.
The solution here was not suitable for my case, because I needed to show a message based on the data processed and generated, and kept in memory, together with downloading it - not before starting anything.
But I came with my own solution, which also works.
1. Add a session variable to store the message
2. In the submit flow, assign it with the message to be shown.
3. Add a hidden button, clicking on which, checks if the session variable has value - then calls FeedbackMessage, and also cleans the variable to not show again.
4. Next some javascript, which clicks a button every second via setInterval().
5. Off course we don't want the clicking to happen all the time, so I a call to setInterval() is in onclick of the submit button, and I also have a timeout parameter (10 seconds), which is checked inside of the clicker function, and calls clearInterval() when reached. 10 seconds is very approximate value of the time which should be enough to prepare data, it can be more, as long as it's not infinite.