[richfaces-issues] [JBoss JIRA] Issue Comment Edited: (RF-11102) NullPointerException in rich:tree node selection

Jay Balunas (JIRA) jira-events at lists.jboss.org
Wed Aug 10 20:34:27 EDT 2011


    [ https://issues.jboss.org/browse/RF-11102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620151#comment-12620151 ] 

Jay Balunas edited comment on RF-11102 at 8/10/11 8:33 PM:
-----------------------------------------------------------

I think we are going to need a small example app to reproduce this issue.  It sounds like you are modifying the tree, and then getting a NPE because of the changes.  We'll need the example to see if this is a bug, or just an issue with how the components are being updated.

I'm going to resolve as incomplete description for now, please reopen when there is more information.

      was (Author: jbalunas):
    I think we are going to need a small example app to reproduce this issue.  It sounds like you are modifying the tree, and then getting a NPE because of the changes.  We'll need the example to see if this is a bug, or just an issue with how the components are being updated.
  
> NullPointerException in rich:tree node selection
> ------------------------------------------------
>
>                 Key: RF-11102
>                 URL: https://issues.jboss.org/browse/RF-11102
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: component-tree
>    Affects Versions: 4.0.0.Final
>            Reporter: u j
>
> In a tree selection listener method I update the tree itself and get a nullpointerexception afterwards:
> {code} 
> 18:43:37,156 SEVERE [org.richfaces.log.Context] null: java.lang.NullPointerException
>     at org.richfaces.model.ClassicTreeNodeDataModelImpl.setupChildContext(ClassicTreeNodeDataModelImpl.java:49) [:4.0.0-SNAPSHOT]
>     at org.richfaces.model.ClassicTreeNodeDataModelImpl.setupChildContext(ClassicTreeNodeDataModelImpl.java:35) [:4.0.0-SNAPSHOT]
>     at org.richfaces.model.NodesTreeSequenceKeyModel.setupKey(NodesTreeSequenceKeyModel.java:47) [:4.0.0-SNAPSHOT]
>     at org.richfaces.model.TreeSequenceKeyModel.setRowKey(TreeSequenceKeyModel.java:49) [:4.0.0-SNAPSHOT]
>     at org.richfaces.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:277) [:]
>     at org.richfaces.renderkit.TreeRendererBase.encodeSelectionStateInput(TreeRendererBase.java:131) [:4.0.0-SNAPSHOT]
>     at org.richfaces.renderkit.html.TreeRenderer.encodeEnd(TreeRenderer.java:145) [:4.0.0-SNAPSHOT]
>     at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.1-FCS]
>     at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763) [:2.1.1-FCS]
>     at org.richfaces.context.ExtendedPartialViewContextImpl$RenderVisitCallback.visit(ExtendedPartialViewContextImpl.java:514) [:4.0.0-SNAPSHOT]
>     at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:337) [:4.0.0-SNAPSHOT]
>     at org.richfaces.component.UIDataAdaptor.visitTree(UIDataAdaptor.java:1235) [:]
>     at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [:2.1.1-FCS]
>     at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [:2.1.1-FCS]
>     at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [:2.1.1-FCS]
>     at javax.faces.component.UIForm.visitTree(UIForm.java:335) [:2.1.1-FCS]
>     at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [:2.1.1-FCS]
>     at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) [:2.1.1-FCS]
>     ...
> {code}
>  
> The problem seems to occur when a node is selected which is not present in the new tree.
> But the implementation should be so robust that there is no exception.
> I do not reassign the bound root node object, instead I remove all child nodes and add the new nodes to the root.
>  
> The tree definition is:
> {code}
> <rich:tree value="#{searchBean.suggestTree}" var="node" id="treeSuggest"
> nodeClass="com.myapp.web.tree.EstabSuggestTreeNode"
> nodeType="#{node.type}" selectionType="ajax"
> toggleType="client" render="treeSuggest,detail"
> selectionChangeListener="#{searchBean.treeSuggestSelectionChanged}">
> <rich:treeNode type="neighborhood">
>     <h:outputText value="#{node.name}" />
>     </rich:treeNode>
>     <rich:treeNode type="estab" >
>     <h:outputText value="#{node.name}" />
> </rich:treeNode>
> </rich:tree>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the richfaces-issues mailing list