Hi, I'm afraid there's no easy solution. But two thoughts are quiete right. Either you can clearTimeout, or wrap the setTimeout method callback (not the settimeout itself!) to check a condition whether it actually can fire ajax request to server. But for both these you will need to slightly modify AbstractAjaxTimerBehavior.
-Matej James McLaughlin wrote: > Hi all, > I have a panel with an AjaxTimerBehavior that can be replaced through an > AjaxLink by another panel. However, this leaves the AjaxTimerBehaviors > setTimeout behind to fire off after the replacement. When it fires and > wicket can't resolve the requested component, a redirect to the > containing page occurs, causing an unsightly refresh and flicker. > > First, is there a way to short circuit this redirect? > > If not, what would be a good pattern for preventing this timeout when > the component is replaced? > > I think the best way would be to wrap the javascript timer function in a > check to see if it should still fire. This will be easy to do if > generated markupIds are unique even when one component replaces another. > Can someone confirm that is the case? Another way would be to capture > the timeoutId and clear it when the component gets replaced. That code > already smells and it hasn't even left my brain :). > > Any other ideas? > > thx, > jim > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > Wicket-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/wicket-user ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Wicket-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-user
