You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@recommind.com> on 2006/04/11 11:45:27 UTC
tree2 should not be rendered
Hi all,
I have a problem with tree2.
One of the trees on my page can be empty without any nodes. In this case
I don't want to render it.
But even when I set the rendered attribute to false (hardcoded below) I
got a NullPointerException.
Why do I get this exception when rendered is set to "false"?
Do I use it wrong?
My BackingBean has session scope.
My STATE_SAVING_METHOD is client.
I don't manually save any states.
Here is my jsp snippet:
<t:tree2 id="assTree"
value="#{MyBean.assignedCategoriesTrees['mykey'].treeData}"
var="node"
varNodeToggler="t"
clientSideToggle="false"
showRootNode="false"
rendered="false"
>
In the above sample treeData is null.
Here is the stack:
org.apache.catalina.core.ApplicationDispatcher invoke: Servlet.service()
for servlet jsp threw exception
java.lang.NullPointerException
at
org.apache.myfaces.custom.tree2.UITreeData.saveState(UITreeData.java:91)
at
org.apache.myfaces.custom.tree2.HtmlTree.saveState(HtmlTree.java:60)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:462)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
javax.faces.component.UIComponentBase.processSaveState(UIComponentBase.j
ava:456)
at
org.apache.myfaces.application.jsp.JspStateManagerImpl.getComponentState
ToSave(JspStateManagerImpl.java:70)
at
org.apache.myfaces.application.jsp.JspStateManagerImpl.saveSerializedVie
w(JspStateManagerImpl.java:215)
at
org.apache.myfaces.taglib.core.ViewTag.doAfterBody(ViewTag.java:139)
...
Any help is appreciated.
Michael