What you're doing right now is to send a request to the server, iterate a
hundred times, replace a component a hundred times, even before the response
from the server reaches the client again.

That what you want to achieve would involve 100 ajax requests and responses,
it IS feasable, but better try a javascript-solution, because 100 roundtrips
is just too much if it's just for changing the label to a fixed value.
But if it's more than that, AjaxSelfUpdatingBehavior might be your friend

Artur W. wrote:
> 
> Hi!
> 
> I try to do something like this
> 
>               final Label counterLabel = new Label("counter", new 
> PropertyModel(this,
> "counter"));
>               counterLabel.setOutputMarkupId(true);
>               add(counterLabel);
> 
>               Form form = new Form("form");
>               add(form);
> 
>               form.add(new AjaxButton("confirmButton") {
>                       @Override
>                       protected void onSubmit(AjaxRequestTarget target, Form 
> form) {
>                               for (int i=0; i <100; i++ ) {
>                                       synchronized (this) {
>                                               try {
>                                                       wait(1000);
>                                               } catch (InterruptedException 
> e) {
>                                                       e.printStackTrace();
>                                               }
>                                               counter += i;
>                                               
> target.addComponent(counterLabel);
>                                       }
>                               }
>                       }
>               });
> 
> 
> The component doesn't refresh. Only for the last time. How to make it
> work?
> 
> 
> Thanks,
> Artur
> 
> 


-----
Michael Sparer
http://talk-on-tech.blogspot.com
-- 
View this message in context: 
http://www.nabble.com/How-to-refresh-component-many-times-in-one-ajax-request-tp14374053p14384523.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to