Sunday, October 9, 2011

Re: Using SafeHtmlTemplate to render a Cell in a CellTree doesn't work

Ok this was actually a problem with the template, generating incorrect HTML. Simplifying the template to a simple <div> with some text gets everything work ok.  

On Sun, Oct 9, 2011 at 11:54 PM, Aidan O'Kelly <aidanok@gmail.com> wrote:
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);
}





--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate