PDA

View Full Version : Check null on ListView.template?



nyklogistics
22 Jun 2009, 12:51 AM
I've got template is null on the line "template.overwrite(...".



@SuppressWarnings("unchecked")
private NodeList<Element> bufferRender(List<M> models) {
Element div = DOM.createDiv();
template.overwrite(div, Util.getJsObjects((List) collectData((List) models, 0),
template.getMaxDepth()));
return DomQuery.select(itemSelector, div);
}

sven
22 Jun 2009, 2:40 AM
You need to post your FULL code to get some help. It is hard so see anything with this three lines.

Colin Alworth
22 Jun 2009, 6:07 AM
Can you post the stack trace from when you get the NPE? I dont see how listview.template can be null at that point.

If you are calling this yourself somehow, you might need to wait until after the render event.