Hello,
I am trying to implement XTemplates in my project and have run across an issue. All the examples / sample code I've seen only use only argument to the template function, so I can't tell what I'm doing wrong.
The code is as follows:
Code:
interface NewsTemplates extends XTemplates {
@XTemplate("<div class='{style.rounded_corners_title}'>{set.sourceName}</div>"
+ "<div class='{style.rounded_corners_content}'>"
+ "<tpl for='items'>{#}</tpl>"
+ "</div>")
SafeHtml newsBlock(GeneralCssResource style, INewsSet set, Collection<INewsItem> items);
}
This code throws a runtime NullPointerException. However, if I comment out the <tpl ...></tpl> section, then it runs perfectly well. According to the GXT 3 javadocs, XTemplate should be able to iterate over a Collection. Unfortunately, all the examples use only one argument and are based on either "." or a value inside that single argument. Does anyone have any advice on how to fix this problem?
EDIT: I've used GWT.log() to check the values of the three variables and all are fine. The exception is thrown before a call to the function can be made (during the GWT.create() process). Apparently, it looks like the generator is unable to parse the code as I've written it...
Regards,
zak.