• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

display progress bar in a pop-up window while waiting

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Bharat Athreya
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic