I have a JSP page where I have a submit button. When user click the submit button, query gets executed in the backend. I need to disable a button till the query gets executed and displayed in 'csv' format. After that i again want to enable the button.
Disabling the button is not a problem, but I am not able to enable the button once the download is complete since once we display the Save As dialog box for CSV download, the control is with the browser.
Is there any way I can enable the button again without manually refreshing the page..
One of the things we do is set a timer on the button so that the user cannot be accidentally pressed again for x seconds. You could get your jsp to open a _blank page that contains the execution for the download and only enable the download button when the page closes.
This seems a tad odd. If your submit is a typical GET/POST for a form to the server then your page is going to reload no matter what. When the page refreshes, assuming your server returns to the same page, your button will be enabled because that is the default behavior when the page first loads.
If you are doing a different type of submit then you need to tell us.
Ok....Actually what we have in the web page exactly is "Save a Copy" button...
1) The user clicks on the "Save a Copy" button. 2) The button should be disabled.. 3) The query will fetch million of records from the database(This will take few minutes)..So we dont want the user to click the button again while processing.. 4) Once the processing is done....we open a CSV file from the servlet program using :