Here's an example off the top of my head (so the disclaimer is it might not be perfect!):
<html><head><title></title></head><body>
<span id="pleaseWait" style="display:none;">Please wait, doing server work...</span>
<span id="mainContent" style="display:block;">
<form name="myForm" method="post" action="whatever.ext">
Field A: <input type="text" name="fieldA"><br>
Field B: <input type="text" name="fieldB"><br>
<input type="submit" value="Call Server" onClick="mainContent.style.display='none';pleaseWait.style.display='block';return false;">
</form>
</span>
</body></html>
Note the return faksel in the onClick of the submit button... I just did this so you'd see it work, without it the form submission proceeds and you won't see anything because you immediately get no return. Or something like that anyway :) The point is, remove that to try this for real against a real server.
I think that'll do it, let me know if you need any further help.
Frank
From: "Marcelo Epstein" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: Re: Action messages. Date: Thu, 3 Jun 2004 13:55:11 -0300
Thanks Frank,
Do you have any sample code of using <SPAN> ? I think this is also good to avoid 2 submit´s click. Am I right?
----- Original Message ----- From: "Frank Zammetti" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 03, 2004 11:57 AM Subject: RE: Action messages.
> You can "fake it" and do this... have a hidden <span> in your page that,
> just before you submit your form, you display. You will probably also
want
> to wrap everything else in your page in a <span> and hide it at the same
> time. I say this is "faking it" because the browser won't have any idea
> what's going on on the server, which might be OK.
>
> If you want some sort of progress bar though, something that actually has
> knowledge of what's going on on the server, what you'll need to do is kick
> off a thread in your Action, and store some reference to it persistently
> (i.e., session or a database, etc.). Then, you'll have to have a page on
> the browser with something like a meta-refresh that calls some special
> Action that can check the status of that thread, maybe get some sort of
> percent complete or something like that to display back to the browser.
>
> Obviously, if faking it is good enough, as it usually is in these cases,
> that's by far the better choice.
>
> Frank
>
> >From: "Marcelo Epstein" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >Subject: Action messages.
> >Date: Thu, 3 Jun 2004 11:46:44 -0300
> >
> >Hi,
> >
> >I have a Action that takes 10s to execute. Is there any way to display
> >messages in the browser during execution?
> >
> >Thx,
> >Marcelo
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> _________________________________________________________________
> MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months FREE!
> http://join.msn.click-url.com/go/onm00200361ave/direct/01/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE! http://join.msn.click-url.com/go/onm00200361ave/direct/01/
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]