you can't do that even now adding a component which id is already in the parent's children see MarkupContainer.add(), line 166
if (put(child) != null) { throw new IllegalArgumentException(exceptionMessage("A child with id '" + child.getId() + "' already exists")); } but the case "add myself as a child" is not covered On Tue, Aug 30, 2011 at 11:36 AM, nino martinez wael <nino.martinez.w...@gmail.com> wrote: > No I guess if all comes to all, its a check to prevent adding a > component more than once to the same form. > > 2011/8/30 Andrea Del Bene <adelb...@ciseonweb.it>: >> Hi nino, >> >> are you proposing to add a check to prevent components from adding themself? >>> >>> Argh sorry I was trying to simplify it. >>> >>> It should state getForm().add(getForm.add(new TextField("id"))). The >>> problem are the double calls to getForm it's wrong and an error.. I >>> just wanted to mention it. >>> >>> regards Nino >>> >>> 2011/8/30 Martin Grigorov<mgrigo...@apache.org>: >>>> >>>> the pasted code is broken >>>> can you paste again ? >>>> >>>> On Tue, Aug 30, 2011 at 10:37 AM, nino martinez wael >>>> <nino.martinez.w...@gmail.com> wrote: >>>>> >>>>> I just made an copy paste error, resulting in this: >>>>> >>>>> getForm().add( >>>>> >>>>> getFlow().add( >>>>> >>>>> However this results wicket running in circles, I know I made an error >>>>> but should'nt wicket complain over the component already has been >>>>> added? >>>>> >>>>> regards Nino >>>>> >>>> >>>> >>>> -- >>>> Martin Grigorov >>>> jWeekend >>>> Training, Consulting, Development >>>> http://jWeekend.com >>>> >>> >> >> > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com