6 Replies Latest reply on Jul 8, 2010 12:52 AM by Manu Gowda

    Rich tree in popup does not fire the nodeSelectListener

    Antonio Gurisatti Newbie

      Hi

       

      I have a rich tree in a popup with the big problem that it does no fire the nodeSelectListener.

       

      I would appreciate any help. I badly need to have trees working ok in popups.

       

      Thanks in advance for any help.

       

      This is the code for the popup

       

      <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">

       

           
      <a4j:form>
          <a4j:outputPanel ajaxRendered="true" layout="block">
              <h:panelGroup rendered="#{simpleCrudGenActn.packageSelectVisible}">
                  <rich:modalPanel id="packageSelectPanel" showWhenRendered="true"
                      minWidth="400" minHeight="300" autosized="true">
                      <f:facet name="header">
                          <h:outputText value="#{msg['common.titleDelete']}" />
                      </f:facet>
                      <rich:effect type="Appear" name="appearFunc" />
                      <rich:tree id="packagetree" switchType="ajax" ajaxKeys="#{null}"
                          value="#{simpleCrudGenActn.packageTreeController.data}" var="comp"
                          treeNodeVar="treeNode" dragIndicator="indicator2"
                          ajaxSubmitSelection="true"
                          nodeSelectListener="#{simpleCrudGenActn.nodeSelectedListener}"
                          nodeFace="#{comp.type}" stateAdvisor="#{stateAdvisor}">
                          <rich:treeNode type="root"
                              icon="/images/component_root.png"
                              iconLeaf="/images/component_root.png">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                          <rich:treeNode type="sourceFolder"
                              icon="/images/source_folder.png"
                              iconLeaf="/images/source_folder.png">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                          <rich:treeNode type="project"
                              icon="/images/project.png" iconLeaf="/images/project.png">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                          <rich:treeNode type="package"
                              icon="/images/package.png" iconLeaf="/images/package.png">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                          <rich:treeNode type="folder"
                              icon="/images/folder.gif" iconLeaf="/images/folder.gif">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                          <rich:treeNode type="comp"
                              icon="/images/folder_page.gif" iconLeaf="/images/folder_page.gif">
                              <h:outputText value="#{comp.nodeName}" />
                          </rich:treeNode>
                      </rich:tree>
                      <rich:spacer width="100%" height="20px"/>
                      <h:panelGroup>
                          <a4j:commandButton id="packageSelectCancel" value="#{msg['common.btnCancel']}"
                              ajaxSingle="true"
                              actionListener="#{simpleCrudGenActn.cancelPackageSelect}" />
                          <rich:componentControl for="packageSelectPanel"
                                  attachTo="packageSelectCancel" operation="hide" event="onclick" />
                      </h:panelGroup>
                  </rich:modalPanel>
              </h:panelGroup>
          </a4j:outputPanel>
      </a4j:form>
      </ui:composition>

       

       

      And this is then listener

       

      public void nodeSelectedListener(NodeSelectedEvent event) {
              UITree tree = (UITree)event.getComponent();
              ComponentTreeNode compNode = (ComponentTreeNode) tree.getRowData();
                 Object selectedObject = compNode.getObject();
                 System.out.println("SELECTED CHANDEICHON: " + compNode.getNodeName());
          }