UiBinder custom panel

82 views
Skip to first unread message

Kurtt

unread,
Aug 27, 2011, 9:40:22 AM8/27/11
to Google Web Toolkit
Hi, all,

is it possible to create a custom panel, and use it just like the
usage of <g:west>:

<my:MyPanel>
<my:colomn_1>
<g:Button/>
</my:colomn_1>
<my:colomn_2>
<g:Button/>
</my:colomn_2>
</my:MyPanel>

where <my:colomn_1> is encountered , i want GWT to call
myPanel.addWidgetToColomn( Widget w, int i) method.

Thomas Broyer

unread,
Aug 28, 2011, 5:22:33 AM8/28/11
to google-we...@googlegroups.com
Yes, simply annotate a method with @UiChild. In your case though, you'd have to have one method per "tag name":

@UiChild(tagname="column_1")
void addWidthToFirstColumn(Widget w) { addWidgetToColumn(w, 0); }

@UiChild(tagname="column_2")
void addWidthToSecondColumn(Widget w) { addWidgetToColumn(w, 1); }

and so on.

Kurtt

unread,
Aug 29, 2011, 4:44:19 AM8/29/11
to Google Web Toolkit
Oh, brilliant. GWT should really develop an UiChild version what can
directly associate to a method like "addWidgetToColomn( Widget w, int
i)".
Thank you ~
:)

On Aug 28, 5:22 pm, Thomas Broyer <t.bro...@gmail.com> wrote:
> Yes, simply annotate a method with @UiChild<http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/googl...>.
Reply all
Reply to author
Forward
0 new messages