When rendering a Cell for a CellTree (for the Leaf Nodes), if I use a SafeHtml Template, I get
com.google.gwt.core.client.JavaScriptException: (TypeError): elem is null
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:248)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
and also,
java.lang.AssertionError: This UIObject's element is not set; you may be missing a call to either Composite.initWidget() or UIObject.setElement()
at com.google.gwt.user.client.ui.UIObject.getElement(UIObject.java:527)
at com.google.gwt.user.cellview.client.CellTree.findItemByChain(CellTree.java:921)
When opening the Leaf Node's parent Node, and when selecting it, respectively.
The Cell does actually render correctly, selection is broken and you can't close the parent mode, but it indicates the template is working.
If I render the the cell without using a SafeHtmlTemplate everything works fine.
Is anyone using SafeHtmlTemplates to render a CellTree's leaf nodes ? (Or can anyone point me to an example of rendering any type of Cell with a SafeHtmlTemplate? )
My render method looks like:
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,Foo value, SafeHtmlBuilder sb) {
SafeHtml x = MyTemplate.templateMethod(value.getBar(), value.getY());
sb.append(x);
}