voyent
Bug Report: ace:tree not working in JSF composite components  XML
Forum Index -> Components
Author Message
MichaelBreu

Joined: 17/Aug/2011 10:08:42
Messages: 19
Offline


Hello,

I think I have found a nasty bug in ICE v 4.3.0 when using <ace:tree> in a composite component and submit the value attribute as a component parameter:

This code in a main xhtml-File
Code:
   <ace:tree value="#{iceFacesTreeBean.treeModel}" var="node">
   	<ace:node>#{node.userObject.name}</ace:node>
   </ace:tree>
 


works, however using ace:tree inside a component with value parameter

Code:
 <html id="html" ...
 	xmlns:ace="http://www.icefaces.org/icefaces/components"
 	xmlns:iceTest="http://java.sun.com/jsf/composite/components/test"
 ...
 <h:body id="body">
   		<iceTest:testTreeValueComponent id="someTree" treeValue="#{iceFacesTreeBean.treeModel}"/>
   
 </h:body>
 </html>
 


with testTreeValueComponent.xhtml
Code:
 <cc:interface>
 	<cc:attribute name="treeValue" type="java.util.List" required="true" />
 </cc:interface>
 
 <cc:implementation>
 	<ace:tree value="#{cc.attrs.treeModel}" var="node">
 		<ace:node>#{node.userObject.name}</ace:node>
 	</ace:tree>
 </cc:implementation>
 


crashes with
Code:
 java.lang.IllegalArgumentException: Navigating to first root of empty model.
 	org.icefaces.ace.model.tree.ListNodeDataModel.navToKey(ListNodeDataModel.java:88)
 	org.icefaces.ace.model.tree.ListNodeDataModel.navToKey(ListNodeDataModel.java:24)
 	org.icefaces.ace.component.tree.Tree.setNodeToKey(Tree.java:159)
 	org.icefaces.ace.component.tree.TreeRenderer.encodeRoots(TreeRenderer.java:196)
 	org.icefaces.ace.component.tree.TreeRenderer.encodeEnd(TreeRenderer.java:84)
 


I will attach a warfile TreeProblemDokumentation.war for testing:
  • .../TreeProblemDokumentation/faces/testPlain.xhtml works
  • ../TreeProblemDokumentation/faces/testTreeValueComponent.xhtml crashes
  • .../TreeProblemDokumentation/faces/testComponent.xhtml works, because it uses ace:tree inside a component, but not with a cc.attrs.-parameter


     Filename TreeProblemDokumentation.war [Disk] Download
     Description
     Filesize 11877 Kbytes
     Downloaded:  74 time(s)

  •  
    Forum Index -> Components
    Go to:   
    Powered by JForum 2.1.7ice © JForum Team