wood burning stoves 2.0*
The moose likes Struts and the fly likes display progress bar in a pop-up window while waiting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "display progress bar in a pop-up window while waiting" Watch "display progress bar in a pop-up window while waiting" New topic
Author

display progress bar in a pop-up window while waiting

Bharat Athreya
Greenhorn

Joined: Mar 09, 2006
Posts: 10
Hi all,

I'm using Struts-1.2.
I invoke a procees when user clicks on SUBMIT. The request takes longer time depending on what the user selects. Inorder to prevent the user from cicking any other buttons in the page, I disabled all the buttons when submitted. But there are links that will be enabled and when the user clicks any of those links, the previous request gets cancelled.

I need to know :

1. How to deactivate a link in a JSP. I use normal <a href="..." > content </a>

2. How to popup a progress bar so that user can never get a chance to click on the page again. This progress bar should be shown until i forward it to the next page.

Hope i'vent confused you.

Thanks in advance,
bharat Athreya


Bharat Athreya
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
If you're developing for Microsoft Internet Explorer, you can use the window.showModalDialog() javascript command to display a modal window. The fact that the popup window is modal prevents the user from clicking on the main page until this window is closed. This also means they won't be able to click on the links in the main page. I'm pretty sure this command works only for IE, though, so you'd have to do some research as to how to do it for other browsers.


Merrill
Consultant, Sima Solutions
Bharat Athreya
Greenhorn

Joined: Mar 09, 2006
Posts: 10
Hi Merill.
Thanks for your quick response.
I'm Using Internet Explorere 6.0.2800 ... My application runs only in Explorer.

Here is the code: i make request from the JAVASCRIPT on click of submt button

function postRequest()
{
if ( confirm("Click OK to confirm the request" ) )
{

document.all['b1'].disabled=true;
document.forms[0].action="createCSV.do";
document.forms[0].submit();
window.showModalDialog();
}
else
alert('User Cancled the request');
}
My Concerns are:

1. While the request is processing i want to show a processing.gif as a popup andthis popup should vanish once the action class is done with the request in the background.

2. I dont want my resultant JSP to be displayed in the Modal dialog box.

3. On poping up a modal dialog box the request is onhold on the background!!!

Please advice as what to do.
Thanks in advance,
Bharat Athreya
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A few Suggestions:

Read this link on how to use the showModalDialog method.

Read this link on how to create a JSP progress bar. The process described in this article is designed to work in a non-Struts JSP/Servlet environment, but with a little imagination you can make it work within the Struts framework.

Change your submit button (<hmtl:submit>) to a regular button (<html:button>). When you call the showModalDialog method, the URL should be a Struts action that creates the TaskBean shown in the URL above and forwards to the progress Bar JSP. This starts whatever process you need to do in the background. The progress bar JSP resubmits itself every 5 seconds to check on the progress. When the taskBean is no longer running, use javaScript to cause the results JSP to be displayed in the main window and close the popup window. Because this is an asynchronous process, you will have to store the ActionForm for the results JSP in the session, rather than the request.

This is only one way to do it, but it should at least give you an idea of what can be done.
Bharat Athreya
Greenhorn

Joined: Mar 09, 2006
Posts: 10
Hi Merill..
Thanks for your link... It was indeed useful....
I'm able to achieve it but not really sticking within the Struts Framework.. I'm working on that....

Thanks a lot for your time.. I whole heartedly appreciate your service!!!

Bharat Athreya
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: display progress bar in a pop-up window while waiting
 
Similar Threads
How to swap out div tags programmatically with JavaScript
sending parameters from JSF to JSF
progress bar problem
onbeforeunload and icefaces
How to show message indicating server processing?