2 Replies Latest reply on Feb 28, 2008 6:53 AM by bibinsga25

    rich:tree and a4j:include integration problem

    bibinsga25

      Hi,
      I want to update a portion of my page based on the selection made on a rich:tree that is within the same page.But I am finding some problem with my code

      I have a nodeselectionListener on my tree,which identifies which node has been selected according to its type,set a bean property which is the value of dynamic viewId
      Node selection listener and viewId property

      
      public void processSelection(NodeSelectedEvent event) {
       UITree tree = (UITree) event.getComponent();
       String selectedNodeType=((CustomerTreeNode)tree.getTreeNode()).getType();
       if(selectedNodeType.equals(CustomerTreeNode.SERVER_NODE)){
       setSelection("server");
      
       }
       if(selectedNodeType.equals(CustomerTreeNode.CUST_DETAILS_NODE)){
       setSelection("details");
       }
       }
      
      public String getCurrentDynamicView(){
       System.out.println("inside current dynamic view");
       if(getSelection().equals("server")){
       System.out.println("Value is server");
       return "/pages/includes/customer-server-edit.jspx";
       }
       if(getSelection().equals("details")){
       System.out.println("value is details");
       return "/pages/includes/customer-info-edit.jspx";
       }
       System.out.println("Something else");
       return "/pages/includes/customer-info-edit.jspx";
       }
      


      this is my a4j:include part

      <a4j:include id="test" viewId="#{customerTree.currentDynamicView}"/>

      I have given 'test' in the reRender list of rich:tree

      So when I select one of the node,say server node,it changes the view in the a4j:include part,but when I switch back to the old view by selecting the default node,Im getting a javascript error (Unknown rutime error).Please help me with this issue