Al Sutton wrote:
OK, it would appear that if any node in the tree has a null for the value of the child property the following error is reported by FreeMarker;

This is really another example of a broader problem with many of the .ftl templates in the struts2 codebase. A previous example has a three character solution: https://issues.apache.org/struts/browse/WW-2383 , for this one it appears that a single "!" may be sufficient.

Excerpted from <http://freemarker.org/docs/dgui_template_exp.html#dgui_template_exp_missing_default>: If the default value is omitted, then it will be empty string and empty sequence and empty hash at the same time.

Expression stack.findValue(parameters.childCollectionProperty.toString()) is undefined on line 24, column 8 in template/ajax/treenode-include.ftl.
The problematic instruction:

I'm not sure how to describe this well, but I'd suggest a broad jira ticket to look through and provide defaults in the .ftl templates for pretty much anywhere there's a "stack.findValue()" call...

Now here's the question; Are we going to allow users to represent leaf nodes in the tree by having a null for the child property, or are we going to say that all nodes must return a valid instance of a java.util.Collection when the child property is fetched?

This basically means all those db objects with collections as attributes need to replace the simple "return FOO" in their getters with "if (FOO==null) return new mumble(); else return FOO". While this isn't a bad idea, I would hate to have the presentation layer break if it's not done..

-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to