You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by dtoffe <dt...@yahoo.com.ar> on 2009/02/25 13:49:45 UTC
AjaxSelfUpdatingTimerBehavior and ModalWindow
Hi,
Is there an easy way of stopping an AjaxSelfUpdatingTimerBehavior when a
ModalWindow is opened, and restarting it again when the modal is closed ??
AbstractAjaxTimerBehavior provides a stop() method, but not a (re)start,
I would like to know if it is possible to get the desired functionality only
by overriding some methods, or if I need to do a customized rewrite of that
class.
tia,
Daniel
--
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p22202102.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
Posted by dtoffe <dt...@yahoo.com.ar>.
There is an enhancement request in Wicket JIRA for this issue, but it is
set to 1.5 release...
http://issues.apache.org/jira/browse/WICKET-1525
In the meantime, the class I created merging
AjaxSelfUpdatingTimerBehavior and AbstractAjaxTimerBehavior is working
fine, although I agree that when the page refreshes on a timer it seems
somewhat sluggish.
hth,
Daniel
satar wrote:
>
> I know this is an old post but it hits an issue I currently have. I want
> to provide the user the ability to turn on/off auto refresh of data from
> the database. If all possible, I would like to use the original
> AjaxSelfUpdatingTimerBehavior or at least the AbstractAjaxTimerBehavior
> but it has the stopped boolean as a private with no way to set it back to
> true and the methods that use it use it directly instead of calling a
> method that I can override -- am I missing something?
>
> The man reason I want to do this is for performance trade-offs. I see that
> if I set the timer off by calling the stop() method, the interface is much
> snappier. It looks like another potential idea may be to override the
> method renderHead, but I cannot override the respond method, which uses
> the stopped boolean.
>
> Is there a better way to handle such a problem -- I am using Wicket
> 1.4-r2.
>
--
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p24595575.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Well.. you could just replace it with a new one..
**
Martin
2009/7/21 satar <st...@gmail.com>:
>
> I know this is an old post but it hits an issue I currently have. I want to
> provide the user the ability to turn on/off auto refresh of data from the
> database. If all possible, I would like to use the original
> AjaxSelfUpdatingTimerBehavior or at least the AbstractAjaxTimerBehavior but
> it has the stopped boolean as a private with no way to set it back to true
> and the methods that use it use it directly instead of calling a method that
> I can override -- am I missing something?
>
> The man reason I want to do this is for performance trade-offs. I see that
> if I set the timer off by calling the stop() method, the interface is much
> snappier. It looks like another potential idea may be to override the method
> renderHead, but I cannot override the respond method, which uses the stopped
> boolean.
>
> Is there a better way to handle such a problem -- I am using Wicket 1.4-r2.
> --
> View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p24593467.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
Posted by satar <st...@gmail.com>.
I know this is an old post but it hits an issue I currently have. I want to
provide the user the ability to turn on/off auto refresh of data from the
database. If all possible, I would like to use the original
AjaxSelfUpdatingTimerBehavior or at least the AbstractAjaxTimerBehavior but
it has the stopped boolean as a private with no way to set it back to true
and the methods that use it use it directly instead of calling a method that
I can override -- am I missing something?
The man reason I want to do this is for performance trade-offs. I see that
if I set the timer off by calling the stop() method, the interface is much
snappier. It looks like another potential idea may be to override the method
renderHead, but I cannot override the respond method, which uses the stopped
boolean.
Is there a better way to handle such a problem -- I am using Wicket 1.4-r2.
--
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p24593467.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
Posted by dtoffe <dt...@yahoo.com.ar>.
I post my solution just in case someone else finds it useful.
I've created a copy of AbstractAjaxTimerBehavior and added the methods
in AjaxSelfUpdatingTimerBehavior. Then I added a start method:
public final void start(final AjaxRequestTarget target) {
stopped = false;
target.getHeaderResponse().renderOnLoadJavascript(
getJsTimeoutCall(updateInterval));
}
In the onClick() of the AjaxLink that opens the ModalWindow, I call
behavior.stop(), then in the close of the ModalWindow, I call
behavior.start(target).
Seems to be working ok so far.
Hope this helps,
Daniel
dtoffe wrote:
>
> Hi,
>
> Is there an easy way of stopping an AjaxSelfUpdatingTimerBehavior when
> a ModalWindow is opened, and restarting it again when the modal is closed
> ??
> AbstractAjaxTimerBehavior provides a stop() method, but not a
> (re)start, I would like to know if it is possible to get the desired
> functionality only by overriding some methods, or if I need to do a
> customized rewrite of that class.
>
> tia,
>
> Daniel
>
>
--
View this message in context: http://www.nabble.com/AjaxSelfUpdatingTimerBehavior-and-ModalWindow-tp22202102p22225064.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org