Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Invalid
-
Affects Version/s: 1.6.1
-
Fix Version/s: 1.6.2
-
Component/s: ICE-Components
-
Labels:None
-
Environment:all
-
Support Case References:
-
Workaround Exists:Yes
-
Workaround Description:If no binding is required, you can remove it and the tree will function correctly.
Description
-
Hide
- tree-basic.war
- 5.35 MB
- Tyler Johnson
-
- META-INF/MANIFEST.MF 0.1 kB
- WEB-INF/faces-config.xml 1 kB
- WEB-INF/web.xml 3 kB
- basicTree.jspx 2 kB
- index.jsp 0.2 kB
- WEB-INF/classes/com/.../basic/TreeBean.class 2 kB
- WEB-INF/classes/com/.../basic/TreeBean.java 2 kB
- WEB-INF/lib/jsf-api.jar 356 kB
- WEB-INF/lib/jsf-impl.jar 778 kB
- WEB-INF/lib/backport-util-concurrent.jar 343 kB
- WEB-INF/lib/commons-beanutils.jar 184 kB
- WEB-INF/lib/commons-collections.jar 558 kB
- WEB-INF/lib/commons-digester.jar 107 kB
- WEB-INF/lib/commons-discovery.jar 70 kB
- WEB-INF/lib/commons-el.jar 110 kB
- WEB-INF/lib/commons-fileupload.jar 52 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/jstl.jar 17 kB
- WEB-INF/.../krysalis-jCharts-1.0.0-alpha-1.jar 151 kB
- WEB-INF/lib/xercesImpl.jar 1.15 MB
- WEB-INF/lib/xml-apis.jar 190 kB
- WEB-INF/lib/icefaces.jar 687 kB
- WEB-INF/lib/icefaces-comps.jar 621 kB
- WEB-INF/lib/el-api.jar 24 kB
- WEB-INF/lib/el-ri.jar 97 kB
- WEB-INF/lib/icefaces-facelets.jar 575 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
With the attached tested case this problem can be reproduced. The problem happens only if the scope of the bean which binds the tree is "session" and the "com.icesoft.faces.concurrentDOMViews" is set to "true".
The page refresh causes the executeJspLifeCycle() to be executed. Which I guess suppose to create a fresh component tree, but it seems like when the concurrentDOMViews is true and the bean scope is set to the session, ICEfaces uses the old "Tree" component instance which already had a child (TreeNode) and the executeJspLifeCycle() on the page refresh creates another child node to the existing Tree component, which already had a child.
That means on page refresh Tree component gets two child nodes and there is a case in the TreeRenderer that it can have only one children, but after page refresh there are two, that is why the TreeRenderer throws the following exception.
com.icesoft.faces.component.tree.MalformedTreeTagException: The tree tag requires a single child treeNode tag. Found [2]
com.icesoft.faces.component.tree.TreeRenderer.encodeBegin(TreeRenderer.java:146)
It is not possible to have a Tree component that is configured to have a session bound binding and run in a cocurrentDOMView=true setup because the binding will be shared between the views. On the first request the Tree component will be created with a TreeNode as a child, on the second request the same Tree component which is acquired this time from the binding, will receive a second TreeNode instance as child.
Really, the solution to this sort of problem would be to get rid of the child tag (ice:treeNode) since the tag doesn't add any functionality that could not be provided by the component (ice:tree) itself.
I still have the same error on Ice 1.7.2_1, also with concurrentDOMView=false. I've tried to use a request scope bean to store tree component binding, but this doesn't solve the error.
I've partially solved the problem creating a personal renderer for Tree that remove the unwanted node from the tree in encoding method.
This is the code in the rebderer:
public void encodeBegin(FacesContext arg0, UIComponent arg1) throws IOException {
// TODO Auto-generated method stub
if (arg1 instanceof Tree) {
Tree t = (Tree)arg1;
if (t.getChildCount()>1)
}
super.encodeBegin(arg0, arg1);
}
it seem good fro me.
Forgot to attach test case. Refresh the page or click the navigate button.