Hi Igor,

It is not that duplicates items are getting rendered. What I want is that
the Js should be rendered ONLY when rendering in non-Ajax mode. In Ajax mode
the Js code should be stripped out. As these Js codes are not executed when
in Ajax response so it doesn't make sense to render them there. This
unnecessarily bloats the response.

Regards,
Apple Grew
my blog @ http://blog.applegrew.com/


On Thu, Apr 22, 2010 at 10:50 PM, Igor Vaynberg <igor.vaynb...@gmail.com>wrote:

> wicket will filter duplicate contributions for you and even though
> they are rendered they are not executed. if you are writing out
> javascript directly you can set a string id which uniquely identifies
> the contribution and wicket will also filter by that.
>
> -igor
>
> On Wed, Apr 21, 2010 at 8:40 PM, Apple Grew <appleg...@gmail.com> wrote:
> > I have a component which contributes Js headers. This component is also
> > rendered by AjaxRequestTarget. The problem is that when rendering ajax
> > response the Js codes too are getting rendered. These Js codes were
> already
> > contributed when this component first rendered (in non-Ajax mode).
> >
> > To fix this what I initially did was that in the onBeforeRender method of
> > the component I was checking if the response NOT isAjax then add the
> header
> > contributors, else, remove them. This was working fine, but problem is if
> I
> > want to implement this is other components I would have to copy n paste
> the
> > codes. So I decided to implement a behavior. I added all the header
> > contributors to that behavior and it was supposed to do the job of adding
> n
> > removing the header contributors. But we can't modify hierarchy from
> > beforeRender of behavior so I am now stuck. Furthermore, this approach is
> > not capable of removing JS contributed by super calsses of the
> componenet.
> >
> > Please suggest.
> >
> > Thanks and regards,
> > Apple Grew
> > my blog @ http://blog.applegrew.com/
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to