On 3/7/07, James McLaughlin <[EMAIL PROTECTED]> 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 :).

Hmmm, yeah, that's interesting. Maybe others thought of this before,
but I hadn't. So we can add header (/body?) contributions via ajax
dynamically now. What we want here is the opposite: remove them when
the linked component was removed/ replaced, right?

Eelco

-------------------------------------------------------------------------
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
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to