wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Vaynberg" <igor.vaynb...@gmail.com>
Subject Re: Wicket id in component
Date Sun, 02 Mar 2008 08:29:58 GMT
a) components need to know their ids, they use them to generate markup id, etc.
b) it is a space optimization. an array of components each with their
own id is cheaper on ram/serialization space then a map.

im sure i could come up with a few more, what is really the advantage
of having put(id,component) ?

-igor


On Sat, Mar 1, 2008 at 11:47 PM, John Patterson <jdpatterson@gmail.com> wrote:
> Hi,
>
>  I haven't really thought this through but I was thinking that if the
>  id of a component was not a member of a Component but set by the
>  parent of the component then child components could be passed to the
>  constructor of the parent.
>
>  Instead of
>
>  Component a = new Component("aid");
>  parent.add(a);
>
>  Having this:
>
>  Component a = new Component();
>  parent.put("aid", a);
>
>
>  It seems to me that a parent component behaves more like a map of
>  child components than a list anyway.  Are there reasons why it does
>  not work this way?  Sorry for what might be a very naive question.
>
>  Thanks,
>
>  John.
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>  For additional commands, e-mail: users-help@wicket.apache.org
>
>

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


Mime
View raw message