How to achieve download and refreshing a button at the same time

How to achieve download and refreshing a button at the same time

  

Hi  Team ,

A button which is having a download functionality when it clicked,
then,

The requirement was to download a file and need to hide the button  after download, 

 1 . when click on "download for update" button need to download excel file, ---- its working fine with onclick submit method to call the screen action.

2. then need to hide the same button , after download --- how to achieve this.

when i use ajax submit 2 is working 1 is not working

when i use submit 1 is working 2 is not woking.

help me to achieve this.

Hi,

You can use a flag variable & provide it as a visibility to your button.

And thus set flag in order to show/hide.


-Assif


Hi Manikandan,

You can implement that behaviour using two different buttons: 

1) a first visible/invisible button, with method ajax submit, that will change it's own appearance and run a javascript action to click on the second button

2) a second hidden button, with method submit, downloads your file

Let me know the results, cheers!

Marco Arede wrote:

Hi Manikandan,

You can implement that behaviour using two different buttons: 

1) a first visible/invisible button, with method ajax submit, that will change it's own appearance and run a javascript action to click on the second button

2) a second hidden button, with method submit, downloads your file

Let me know the results, cheers!

To add to this more specifically, for step 1 use the Widget_Click action from RichWidgets, and for the hidden button you can just give it a style of display:none;


Hi Manikandan K,

- A Small contribution from my side to achieve the implementation as per your requirement:

1) Button1 - View BOM

Button2 - Download For Update

Button3 – Hidden (Set Visible property to True and style: “display: none;”)

2) Set the Visible property of Button 2 (Download for update) to not IsDownload. Where the IsDownload is a local variable of Boolean type with default value set to False.


3) Action flow for Button2 (Download for Update). In the flow you will assign the IsDownload = True and click the Hidden Button3 using widget_click action.

Note: Set the Button1 and Button3 with Submit Method as: Ajax Submit 
and Button2 Method: Submit


4) Action flow for Button3 (Hidden Button) where you will refresh the Button 1 using ajax Refresh and click the View BOM Button using widget_click.

5) Action flow for Button2 (View BOM) where you will check whether the local variable IsDownload = True, if so you will download the .xlsx file.

It's done.

Additional:

You can get the Wiget_Click Server action from

Hope that you understood the above stated explanation.


Kind Regards,

Benjith Sam