Hello all wicket users!
Does anybody know why id is added to component, not to list of children, like:
add("someId", childComponent);
Thank you very much.
-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additi
Because it is imperative in many ways that the component knows it's own ID.
Look through the code to see how many times it uses it's ID.
Hope this helps.
--
Jeremy Thomerson
http://www.wickettraining.com
On Thu, Jan 15, 2009 at 9:40 PM, Anton Veretennikov <
anton.veretenni...@gmail.com> wrote:
> Because it is imperative in many ways that the component knows it's own ID.
> Look through the code to see how many times it uses it's ID.
Do you mean that instance needs to know ID BEFORE it was added?
If not, add() can internally set ID of component sent as parameter.
If one child can't have o
add(Component) has at least these advantages over add(String, Component):
- most efficiently expresses the semantics of the operation (simplicity)
- makes the id effectively immutable (reliability)
- since you can't construct a component without an id, you know by
definition that any Componen
Can i then do this?
Component x = new Component()
parent.add('first', x)
parent.add('second',x)
Or should it then throw an exception at runtime (it wil in develop mode)
And if there are situations that the component wants to know its name
before its added to the parent (in its constructor for ex