I am experiencing an unusual problem when using Tree in Internet Explorer. When expanding a node that is dynamically populated using nodeExpandListener, there is an extra node rendered at the bottom of the node list in IE8 (or, in IE7 at the top of the list). Attempting to expand this node results in a NumberFormatException with message 'For input string: "undefined"'. Mozilla Firefox 3.6 renders the tree as expected. Please note that the error only occurs as an extra node in the child list of a node that has just been expanded - rendering a tree with pre-expanded nodes does not result in the error.
Code for the Facelet displaying the tree is as follows:
Code: Select all
<ui:composition>
<p:tree id="#{id}" value="#{backingBean.model}" var="node" dynamic="true"
nodeExpandListener="#{backingBean.onNodeExpand}"
nodeSelectListener="#{backingBean.onNodeSelect}"
selection="#{backingBean.selectedNodes}"
selectionMode="single" update="#{update}">
<p:treeNode>
<h:outputText value="#{node}"/>
</p:treeNode>
</p:tree>
</ui:composition>
Code: Select all
for (SupplierCategory cat : categorisedMap.keySet()) {
TreeNode catNode = new DefaultTreeNode(cat, node);
for (PriceChangeType type : categorisedMap.get(cat).keySet()) {
TreeNode typeNode = new DefaultTreeNode(type, catNode);
for (PriceChangeRequest rq : categorisedMap.get(cat).get(type)) {
TreeNode rqNode = new DefaultTreeNode(rq, typeNode);
}
}
}
The current system is running a stack of Spring 3.0.5, Mojarra 2.0.2 and Primefaces 2.2 RC2.
Thanks
Jim