I have built a test gui that shows up correctly. I tried to
dynamically add some widgets to a panel, but I could not see them. So
I simplified the code to add a label to a panel when I click a button.
My component, that the is build via uiBinder, contains the following
two methods:
public void open() {
if(p1 == null) {
p1 = new FlowPanel();
splitPanel.add(p1);
}
p1.add(new Label("LABELLLLL"));
}
@UiHandler("addMenu")
void handleClick(ClickEvent e) {
// send an event that calls open(), just to see what
happens
AppControler.eventBus().fireEvent(new OpenedMenuEvent());
// call open directly
open();
}
What happens in the fist line of handleClick is that the event sent
via the bus correctly calls the open() method, but the label is not
added to the panel.
The direct call to open() of the second line works: I can see the
label.
Finally If I call open() from another component I get no errors but
the label does not show up.
This behaviour puzzles me, especially because even when the added
label does no show up the code executes regularly (I stepped through
it with the debugger) and the same three lines of code are executed,
only called from different places.
I am stuck, because I need to add ui components dinamically, but I
have this strange problem and it looks like I cannot decouple my
components.
Any idea?
Thanks in advance Francesco
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
No comments:
Post a Comment