instead of using ajaxrequettarget.appendjavascript() use
iheadercontributor#renderOnDomReadyJavascript(String), these
contributions are filtered and only unique ones are executed.

the ordering is a different problem. if you need such ordering instead
of using headercontributor let your components implement some other
interface and let the parents visit children that implement that
interface so it can collect and sort the javascript however it sees
fit before writing it out.

-igor


On Wed, Sep 14, 2011 at 6:10 AM, armandoxxx <armando....@dropchop.com> wrote:
> Hi guys
>
> I have a question about how to avoid multiple evaluations of same
> javascripts in AjaxRequestTarget.appendJavaScript().
> I have a lots of components that append javascript to AjaxRequestTarget.
> Some of these javascript strings are same and some are different. So what
> I'm trying to figure out is how to avoid adding the same javascript to
> AjaxRequestTarget.
> Another thing I'm trying to figure out is how to add these strings in
> appropriate order.
>
> use case:
> - ajax button is clicked
> - an event is created (AjaxRequestTarget is set as parameter) and send to
> components
> - Component A gets an event .. adds itself to AjaxRequestTarget and appends
> some JS ("resizeLayout()");
> - Component B gets an event .. adds itself to AjaxRequestTarget and appends
> some JS ("resizeLayout()", "initScrollbar('ComponentB')");
> - Component C gets an event .. adds itself to AjaxRequestTarget and appends
> some JS ("resizeLayout()", "initScrollbar('ComponentC')");
>
>
> Kind regards
> Armando
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/Wicket-1-5-AjaxRequestTarget-appendJavaScript-multiple-javascript-evaluations-tp3812785p3812785.html
> Sent from the Users forum 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

Reply via email to