Alex Objelean wrote:
> 
> AjaxSelfUpdatingTimerBehavior implements IBehavior interface, which has
> the following method:
> boolean isEnabled(Component component); 
> 
> Override it and provide your business logic there.
> 
 
I must do something wrong becouse it doesn't start refreshing.

My refreshing label:

                counterLabel.add(new 
AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) {
                        @Override
                        protected void onPostProcessTarget(AjaxRequestTarget 
target) {
                                if (counter == 0 && confirmed) {
                                        window.close(target);
                                }
                        }
                        @Override
                        public boolean isEnabled(Component component) {
                                return confirmed;
                        }
                });
                counterLabel.setOutputMarkupId(true);
                add(counterLabel);

My confirm button:

                form.add(new IndicatingAjaxButton("confirmButton", form) {
                        @Override
                        protected void onSubmit(final AjaxRequestTarget target, 
Form form) {

                                confirmed = true;

                
                                setEnabled(false);
                                setOutputMarkupId(true);

                                new Thread() {

                                        public void run() {
                                                //do something here
                                                counter--;
                                        }
                                        
                                }.start();
                                target.addComponent(this);
                                target.addComponent(counterLabel);
                        }

Artur

-- 
View this message in context: 
http://www.nabble.com/How-to-refresh-component-many-times-in-one-ajax-request-tp14374053p14395329.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