And they give this example for adding your UIBinder object to your application:
Document.get().getBody().appendChild(helloWorld.getElement());
Maybe that's OK for an HTML UIBinder. I haven't tried that.
Instead, I was using GWT widgets in my UIBinder, and I wanted to add a ClickHandler to one of my buttons. But nothing ever happened when I clicked it. Turns out, as I read on Stack Overflow, that indeed the handlers aren't initialized properly unless you add to the root panel.
So here's what I did that worked just fine:
RootPanel.get().add(helloWorld);
Thanks, Hilbrand!
No comments:
Post a Comment