Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
Well.. you could just replace it with a new one.. ** Martin 2009/7/21 satar starl...@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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
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-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: AjaxSelfUpdatingTimerBehavior and ModalWindow
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-tp22202102p5064.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org