Thursday, August 11, 2011

Add UIBinder widget to root panel

This page from the GWT doc is very helpful for getting start with UIBinder.

And they give this example for adding your UIBinder object to your application:


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:


Thanks, Hilbrand!

No comments: