i think the correct way what would be this:

1) write a mixin that collects the ids of the components in a global 
service/aso/whatever

2) after the page has rendered (maybe with a heartbeat or with 
in a MarkupRendererFilter service after renderMarkup(...)) use 
the collected ids and generate a javascript array

3) add javascript functions to your page that use the javascript array
to register eventhandler for every component id

with prototype you'd do somthing like that
$(element).observe("click",handler); 

4) let the registered event handler show the progress bar...
and let the event bubble up!!!

with prototype do NOT call following line:
Event.stop(event);

also take a closer look at PageRenderSupport for javascript
rendering

g,
kris

ps: don't use onClick anymore... instead always register event 
handlers; see www.quirksmode.org for more details on events






Harald Geritzer <[EMAIL PROTECTED]> 
13.03.2008 15:41
Bitte antworten an
"Tapestry users" <users@tapestry.apache.org>


An
Tapestry users <users@tapestry.apache.org>
Kopie

Thema
Re: T5: Please wait before I show you next page







Angelo Chen schrieb:
> Hi Kris,
> 
> mixin is interesting, is there a simple sample that I can learn from ?
> thanks.

if you assign that mixing to a submit component, on click the javascript 
function 
showProgressIndicator is called. the only drawback is, if you do client 
side validation and there is 
an error, no roundtrip to the server is done and the message stays on 
screen :-(

@MixinAfter
public class ProgressIndicator {
 
                 @Parameter(value="message:progress-message-label", 
defaultPrefix="message")
                 private String _message;

                 void beginRender(MarkupWriter writer) {
                                 writer.getElement().attribute("onClick", 
"javascript: showProgressIndicator('" + _message + "');");
                 }
}

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to