Chaining returns the object you invoked the method on.

Your example should look like this:
add(new MyPanel("panel02").setVisible(false));

with chaining you can do this:
add(new MyPanel("panel02").setVisible(false)).add(new
Label("label").setVisible(false));

-Igor


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:wicket-user-
> [EMAIL PROTECTED] On Behalf Of Michael Jouravlev
> Sent: Thursday, September 29, 2005 11:11 AM
> To: [email protected]
> Subject: [Wicket-User] Why does MarkupContainer.add returns this?
> 
> I understand why StringBuffer.append returns this, but I would expect
> from MarkupContainer.add to return reference to added object. When
> StringBuffer.append.append.append is used, the content is chained into
> single object, while MarkupContainer.add.add.add would add a child to
> container.
> 
> It would also allow to write something like this:
>   add(new MyPanel("panel02")).setVisible(false);
> 
> Am I wrong here? Most likely I am ;-)
> 
> Michael.
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> 





-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to