-
1. Re: dynamic tree and nodeselectlistener problem
nbelaevski Jan 28, 2009 5:59 PM (in response to walleye160)Hello,
The provided information is not enough to assist you on the issue. Please post bean and page code. -
2. Re: dynamic tree and nodeselectlistener problem
walleye160 Jan 29, 2009 3:15 PM (in response to walleye160)here is the page code
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"> <rich:tree value="#{RootNode.data}" var="item" nodeFace="#{item.type}" switchType="ajax" ajaxSubmitSelection="true" reRender="selectedNode" nodeSelectListener="#{projectTreeListener.processSelection}"/> <rich:treeNode type="my_project" > <h:outputText value="#{item.name}" /> </rich:treeNode> <rich:treeNode type="Project" iconLeaf="#{item.iconPath}" icon="#{item.iconPath}"> <h:outputText value="#{item.title}" /> </rich:treeNode> <rich:treeNode type="project_summary" iconLeaf="#{item.iconPath}" icon="#{item.iconPath}"> <h:outputText value="#{item.title}" /> </rich:treeNode> <rich:treeNode type="project_timeline" iconLeaf="#{item.iconPath}" icon="#{item.iconPath}"> <h:outputText value="#{item.title}" /> </rich:treeNode> </rich:tree> </ui:composition>
here is my bean:import javax.faces.event.*; import org.richfaces.event.*; import org.richfaces.model.TreeNode; import org.richfaces.component.*; import org.apache.commons.logging.*; import sun.util.logging.resources.logging; public class ProjectTreeListener implements org.richfaces.event.NodeSelectedListener{ private boolean is_project_panel = true; private boolean is_maintenance_panel = false; private boolean is_program_panel = false; // public ProjectTreeListener() { // is_project_panel = true; // is_maintenance_panel = false; // is_program_panel = false; // } public void processSelection(NodeSelectedEvent event) throws AbortProcessingException { System.out.println("node selected"); } }
try to debug, but the method never been called.
thanks for any help -
3. Re: dynamic tree and nodeselectlistener problem
nbelaevski Jan 29, 2009 7:40 PM (in response to walleye160)Looks ok. Does expansion works ok? Also can you please create a simple demo project showing the issue? You can send it to nbelaevski at exadel dot com
-
4. Re: dynamic tree and nodeselectlistener problem
walleye160 Jan 30, 2009 11:07 AM (in response to walleye160)yes, the expansion works okay. RootNode connects to database and loads MyProjectNode (for now), MyProjectNode will load project list as ProjectNode. The selection listener doesnot work even I use some fake data.
I will try to come up a simple project demo.
Thanks -
5. Re: dynamic tree and nodeselectlistener problem
erm0 Feb 3, 2009 3:35 PM (in response to walleye160)I have the exact same issue, and I'm unable to make this thing work, however I try...
Here's my jsp :<rich:tree switchType="ajax" value="#{modeleBean.treeRoot}" var="item" ajaxSubmitSelection="true" nodeSelectListener="#{modeleBean.onSelectTreeNode}"> <rich:treeNode> <h:outputText value="#{item.name}" styleClass="texteDefault"></h:outputText> </rich:treeNode> </rich:tree>
And the method in my bean :public void onSelectTreeNode(NodeSelectedEvent event) { // some code here; }
Do we missed something??
Thanks -
6. Re: dynamic tree and nodeselectlistener problem
erm0 Feb 5, 2009 10:02 AM (in response to walleye160)Looks like my problem was caused by Ext JS. I didn't know that there was a possible conflict with Ext JS and that ajax fonctionnality in Rich Faces could stop working. So, problem solved...