I think you missunderstood the reason for ui.xml-Files. They are a
coding time solution to simplify definition of UI by simply using xml.
As far as I understood your problem you want to react to e.g. a
ClickEvent and add some widget to a panel at runtime. For menuPanel
you could simply use
menuPanel.add( new MyWidget() );
where MyWidget is the widget you want to add.
Otherwise doing this declaratively you would have to create your own
widget implementing HasWidgets, if you don't find any appropriate
Panel. I had some cases where I created a widget - let's call it
MyWidget - which contained some "special" contentPanel. this was
normally something like
<g:VerticalPanel ui:field="contentPanel" />
Doing that I delegated the methods of HasWidgets of my MyWidget to the
field contentPanel, e.g:
@Override
void add(Widget w){
contentPanel.add(w);
}
after including MyWigets package as a
xmlns:mw='urn:import:com.example.widgets' in the ui.xml file you can
easily make something like that:
<mw:MyWidget>
<g:Button>hello world</g:Button>
</mw:MyWidget>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.