Custom widgets containing other HTML/widgets
I'm trying to create a custom widget that would internally be
represented by a simple DIV
and a BUTTON
element, but which would accept
other widgets inside it, pretty much like HTMLPanel
.
So, I want something like this...
<div class="XXX">
<button class="YYY"></button>
{other widget(s) here}
</div>
...encapsulated inside some widget, say WrapperWidget
. Then, I could use
this WrapperWidget
inside some other (multiple) ui.xml files:
<ns:WrapperWidget>
<ul>
<li>item 1</li>
<li>item 2</li>
</ul>
</ns:WrapperWidget>
How is that achievable in GWT?
Thanks!
I don't use UI binder, so I can't help you there. To nest widgets, one would usually use a Composite http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/ui/Composite.html
精彩评论