Sunday, January 22, 2017

Callback for CellList cell attaching to DOM?

Is it possible to register a callback for when a CellList cell has attached to the DOM?  And if not, any ideas on how to solve this problem?

The problem occurs when I am embedding an interactive Google Map into a cellList cell.  Since the div element which will contain the map exists within the cell, I need to make sure the cell loads, otherwise my call to getElementById will return null.  Using a Timer, I can guess how long it will take, and usually it will work, but I would much rather respond to a callback. 

For example, in my ui:binder cell I pass a predetermined "mapId" to the cell.  This allows be to then access that specific element outside of the cell rendering, and then pass that element to the Google Maps API. 

Again, I have this working, but only by guessing a wait time with a Timer which leads to obvious issues.

<ui:with type="java.lang.String" field="mapId" />

<div id="{mapId}" style="height:15em" />

You received this message because you are subscribed to the Google Groups "GWT Users" 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