You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jbrookover <jb...@cast.org> on 2011/07/27 17:25:21 UTC

Target.addComponent - Single Container vs Multiple Components

I come across this scenario quite a bit.  Say I have a Container/Fragment/etc
with several (~10) child components, and I'm using Ajax to toggle the
visibility of a small set (~4) of those children.  The other children are
unchanged by the Ajax call.

Are there a performance (or other) considerations between:

target.addComponent(container);

and

target.addComponent(child1);
target.addComponent(child2);
target.addComponent(child3);
target.addComponent(child4);

The first option is much cleaner, but will (I presume) run the
onBeforeRender/onConfigure/etc methods of all 10 the children.  On the other
hand, the second method might have some client-side javacript overhead and
or other Ajax-y overhead that I'm not aware of.

Thoughts?

Thanks!

Jake

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/Target-addComponent-Single-Container-vs-Multiple-Components-tp3698864p3698864.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Target.addComponent - Single Container vs Multiple Components

Posted by Martin Grigorov <mg...@apache.org>.
At server side it is basically the same.
At client side (javascript) repainting just one component should be faster.

On Wed, Jul 27, 2011 at 6:25 PM, jbrookover <jb...@cast.org> wrote:
> I come across this scenario quite a bit.  Say I have a Container/Fragment/etc
> with several (~10) child components, and I'm using Ajax to toggle the
> visibility of a small set (~4) of those children.  The other children are
> unchanged by the Ajax call.
>
> Are there a performance (or other) considerations between:
>
> target.addComponent(container);
>
> and
>
> target.addComponent(child1);
> target.addComponent(child2);
> target.addComponent(child3);
> target.addComponent(child4);
>
> The first option is much cleaner, but will (I presume) run the
> onBeforeRender/onConfigure/etc methods of all 10 the children.  On the other
> hand, the second method might have some client-side javacript overhead and
> or other Ajax-y overhead that I'm not aware of.
>
> Thoughts?
>
> Thanks!
>
> Jake
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/Target-addComponent-Single-Container-vs-Multiple-Components-tp3698864p3698864.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org