You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Tokalak Ahmet <to...@yahoo.de> on 2009/06/29 10:22:43 UTC

AjaxSelfUpdatingTimerBehavior: Leaving page not possible

Hi Wicketians,

i have a problem with AjaxSelfUpdatingTimerBehavior.

I have added an AjaxSelfUpdatingTimerBehavior to a page, because of a background-thread running very long and the 
page checks (an AjaxSelfUpdatingTimerBehavior with 10 sec interval added at thread start to page) for the termination of the thread and showing the results of thread.

It is in theory possible to leave the page while the background thread is running and come back to it at a later time.
But in practice it isn't possible to leave it, the behavior reloads the page again and again until the thread ends and the behavior is removed from the page. 

Any idea how to solve this problem?
Thank you in advance.



      

AW: AjaxSelfUpdatingTimerBehavior: Leaving page not possible

Posted by Tokalak Ahmet <to...@yahoo.de>.
Thank you Martin for your quick answer.

I think the problem is caused by the background-thread. 
I do start the thread with a low priority and as daemon but the application seems still waiting for the termination of the started thread.
Very strange





________________________________
Von: Martin Funk <ma...@googlemail.com>
An: users@wicket.apache.org
Gesendet: Montag, den 29. Juni 2009, 11:10:51 Uhr
Betreff: Re: AjaxSelfUpdatingTimerBehavior: Leaving page not possible


Am 29.06.2009 um 10:22 schrieb Tokalak Ahmet:

> Hi Wicketians,
> 
> i have a problem with AjaxSelfUpdatingTimerBehavior.
> 
> I have added an AjaxSelfUpdatingTimerBehavior to a page, because of a background-thread running very long and the
> page checks (an AjaxSelfUpdatingTimerBehavior with 10 sec interval added at thread start to page) for the termination of the thread and showing the results of thread.
> 
> It is in theory possible to leave the page while the background thread is running and come back to it at a later time.
> But in practice it isn't possible to leave it, the behavior reloads the page again and again until the thread ends and the behavior is removed from the page.
In theory, practice is always easy :-)

Though I don't quite understand your problem.
The ASUTB generates some JavaScript that instructs the Browser to fire an AjaxRequest right back to that Behavior on the Server.
If the user leaves the page (on the browser) this JavaScript is disabled, no more calls to the browser.
If the user comes back to that page, even if it is loaded from the browser cache, those Ajax-calls start again.
Look at the clock example of the ajax examples in the wicket examples.
Also the AjaxRequest doesn't reload the whole page, it just reloads the components that are added to the target in the overridden 'onTimer' method.

To stop the Timer a removal is not needed, a call to its 'stop()' method does the same trick.

Hopefully this helps, if not, come back,

mf
> 
> Any idea how to solve this problem?
> Thank you in advance.
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


      

Re: AjaxSelfUpdatingTimerBehavior: Leaving page not possible

Posted by Martin Funk <ma...@googlemail.com>.
Am 29.06.2009 um 10:22 schrieb Tokalak Ahmet:

> Hi Wicketians,
>
> i have a problem with AjaxSelfUpdatingTimerBehavior.
>
> I have added an AjaxSelfUpdatingTimerBehavior to a page, because of  
> a background-thread running very long and the
> page checks (an AjaxSelfUpdatingTimerBehavior with 10 sec interval  
> added at thread start to page) for the termination of the thread and  
> showing the results of thread.
>
> It is in theory possible to leave the page while the background  
> thread is running and come back to it at a later time.
> But in practice it isn't possible to leave it, the behavior reloads  
> the page again and again until the thread ends and the behavior is  
> removed from the page.
In theory, practice is always easy :-)

Though I don't quite understand your problem.
The ASUTB generates some JavaScript that instructs the Browser to fire  
an AjaxRequest right back to that Behavior on the Server.
If the user leaves the page (on the browser) this JavaScript is  
disabled, no more calls to the browser.
If the user comes back to that page, even if it is loaded from the  
browser cache, those Ajax-calls start again.
Look at the clock example of the ajax examples in the wicket examples.
Also the AjaxRequest doesn't reload the whole page, it just reloads  
the components that are added to the target in the overridden  
'onTimer' method.

To stop the Timer a removal is not needed, a call to its 'stop()'  
method does the same trick.

Hopefully this helps, if not, come back,

mf
>
> Any idea how to solve this problem?
> Thank you in advance.
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org