Rerendring problem in Tree when click the node: I dont want
navinmca Jun 28, 2007 3:17 PMHi Friends,
On click of tree node I want to fire some ajax request but I donot want the same tree to be rerender.
Bcas the tomhalk tree is generated with help of treeBean which is set in request scope.
The jsp page is having two regions one for tree & one for ListBox.
Wht I want : on click of the tree 's any node. I want only rerender the ListBox region and want to fire some action event.
Wht is happening:
But currently when I click on the tree node It tryies to call the treebean.treedata method to render the tree which is stored in request scope hence throwing a null pointer exception(bcas onclick of node 's ajax request I m not setting the treebean again).
Pls help me to solve this problem
regards,
Novin
treeroot
'
'--------------TreeNode (onclick I m firing one ajax reqest)
The node code in JSP:
<f:facet name="document"> <a4j:outputPanel id="grp3" > <h:outputLink id="temp3" value="#"> <h:outputText id="temp4" value="#{node.description}"/> <a4j:support event="onclick" action="#{accountAction.getAllAccGrpNumber}" reRender="region_AccountDetail.accGrpNameNumPanel" limitToList="true"/> </h:outputLink> </a4j:outputPanel> </f:facet>
<f:subview id="accounttreesubview"> <h:form id="frmAccountGrpupUpdate"> <a4j:outputPanel ajaxRendered="true"> <h:messages/> </a4j:outputPanel> <!-- Start :region_region_Tree --> <a4j:region id="region_Tree"> <t:tree2 id="clientTree" value="#{accountTreeBean.treeData}" var="node" varNodeToggler="t" > <f:facet name="person" > <a4j:outputPanel id="grp1"> <h:outputText value="#{node.description}" id="temp1"/> </a4j:outputPanel> </f:facet> <f:facet name="foo-folder"> <a4j:outputPanel id="grp2"> <h:outputText value="#{node.description}" id="temp2"/> </a4j:outputPanel> </f:facet> <f:facet name="document"> <a4j:outputPanel id="grp3" > <h:outputLink id="temp3" value="#"> <h:outputText id="temp4" value="#{node.description}"/> <a4j:support event="onclick" action="#{accountAction.getAllAccGrpNumber}" reRender="region_AccountDetail.accGrpNameNumPanel" limitToList="true"/> </h:outputLink> </a4j:outputPanel> </f:facet> </t:tree2> </a4j:region> <!-- End :region_region_Tree --> <!-- Start :region_AccountDetail --> <a4j:region id="region_AccountDetail"> <h:panelGroup id="GrpNamePanel"> <h:selectOneListbox id="accountGrpNameList" value="#{accountChangeGroupBean.selectedGrpName}" size="3" > <f:selectItems value="#{accountChangeGroupBean.accountGrpNameList}" /> <a4j:support event="onchange" action="#{accountAction.getAccountGrpNumberList}" reRender="GrpNumberPanel" ajaxSingle="true" limitToList="true"/> </h:selectOneListbox> </h:panelGroup> </a4j:region> <!-- End :region_AccountDetail --> </h:form> </f:subview>
Exception:
[Servlet Error]-[Faces Servlet]: java.lang.NullPointerException
at org.apache.myfaces.custom.tree2.UITreeData.getDataModel(UITreeData.java:449)
at org.apache.myfaces.custom.tree2.UITreeData.setNodeId(UITreeData.java:349)
at org.apache.myfaces.custom.tree2.HtmlTree.setNodeId(HtmlTree.java:109)
at org.apache.myfaces.custom.tree2.UITreeData.processDecodes(UITreeData.java:174)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:914)
at org.ajax4jsf.framework.ajax.AjaxViewRoot$1.invoke(AjaxViewRoot.java:252)
at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:75)
at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:80)
at org.ajax4jsf.framework.ajax.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.ja