Friday, August 30, 2013

Re: Correct way to sink events on UiBinder Element

Thanks all. The addDomHandler suggestion worked wonderfully for my needs.

On Tuesday, August 27, 2013 11:55:47 AM UTC-4, Thomas Broyer wrote:

On Tuesday, August 27, 2013 5:01:07 PM UTC+2, Shaun Tarves wrote:

Thanks for the heads up about the leak. How would I use "uibinder for
cells" if I am just creating a standard Composite-based widget?

Either you compose widgets, or you go low-level and then you can use "uibinder for cells" to work at the element-level.

What would an event delegation path look like at the composite level?
Do I just sink the events on this.getElement() and then check if the
event target is my UiField Element?

Basically, yes (you'd use addDomHandler or override onBrowserEvent though rather than "sink the events on this.getElement()")

With "uibinder for cells" (aka UiRenderer), you'd either build a Cell to use in CellWidget (have a look at TextButton for an example of such widget, even though it doesn't use UiRenderer) or extend Widget. In the latter case, you can render() your element into some root element (say, a <div>) using setInnerHTML, and delegate the widget's onBrowserEvent to the UiRenderer's onBrowserEvent, so it will do the dispatch to the appropriate @UiHandler method. And you can possibly get the inner elements to manipulate them directly.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment