5 Replies Latest reply on Jun 13, 2009 12:19 AM by Saurav Biswas

    TabPanel of switchType=

    Saurav Biswas Newbie

      I have a TabPanel which is of switchType="ajax". In one of the tabs I have a Tree. If I click on the tab nothing happens. The tab is not rendered. I have put a breakpoint in the bean used by the tree and do see it getting there. But when I refresh the page the tab does get rendered (BTW, I maintain the selected tab on the severside.)

      JSP Code:

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
      
      <rich:tabPanel switchType="ajax">
       <rich:tab id="__tab_home" label="Home">
       <rich:panel styleClass="rich-laguna-panel-no-header">
       The home page here!!!
       </rich:panel>
       </rich:tab>
       <rich:tab id="__tab_objects" label="Objects">
       The search panel goes here.
       </rich:tab>
       <rich:tab id="__tab_reports" label="Reports">
       <rich:tree
       style="width:200px;"
       switchType="client"
       value="#{myTree.rootNode}"
       var="item">
       <rich:treeNode>
       <h:outputText value="#{item.name}" />
       </rich:treeNode>
       </rich:tree>
       </rich:tab>
      </rich:tabPanel>
      


      Bean Code:
      public class MyTreeBean {
      
       private TreeNode _rootNode;
      
       public TreeNode getRootNode() {
       if (_rootNode == null)
       loadTree();
       return _rootNode;
       }
      
       private void loadTree() {
       System.out.println("Loading KM Tree ...");
       _rootNode = new TreeNodeImpl();
      
       {
       TreeNodeImpl treeNode = new TreeNodeImpl();
       treeNode.setData("Departments");
       _rootNode.addChild(new Integer(1), treeNode);
       }
       {
       TreeNodeImpl treeNode = new TreeNodeImpl();
       treeNode.setData("Resources");
       _rootNode.addChild(new Integer(2), treeNode);
       }
      
       System.out.println("Finished loading KM Tree ...");
       }
      
       public void processSelection(NodeSelectedEvent event) {
       }
      
      }
      


      When I click on the "Report" tab it does not render.

      RichFaces Version: 3.3.0
      Server: WebLogic 10
      Browser: IE and FireFox

      Any kind of help is appreciated.

      Thanks,
      -saurav

        • 1. TabPanel of switchType ajax not rendering when it contains a
          Saurav Biswas Newbie

          I have a TabPanel which is of switchType="ajax". In one of the tabs I have a Tree. If I click on the tab nothing happens. The tab is not rendered. I have put a breakpoint in the bean used by the tree and do see it getting there. But when I refresh the page the tab does get rendered (BTW, I maintain the selected tab on the severside.)

          JSP Code:

          <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
          <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
          <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
          <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
          
          <rich:tabPanel switchType="ajax">
           <rich:tab id="__tab_home" label="Home">
           <rich:panel styleClass="rich-laguna-panel-no-header">
           The home page here!!!
           </rich:panel>
           </rich:tab>
           <rich:tab id="__tab_objects" label="Objects">
           The search panel goes here.
           </rich:tab>
           <rich:tab id="__tab_reports" label="Reports">
           <rich:tree
           style="width:200px;"
           switchType="client"
           value="#{myTree.rootNode}"
           var="item">
           <rich:treeNode>
           <h:outputText value="#{item.name}" />
           </rich:treeNode>
           </rich:tree>
           </rich:tab>
          </rich:tabPanel>
          


          Bean Code:
          public class MyTreeBean {
          
           private TreeNode _rootNode;
          
           public TreeNode getRootNode() {
           if (_rootNode == null)
           loadTree();
           return _rootNode;
           }
          
           private void loadTree() {
           System.out.println("Loading KM Tree ...");
           _rootNode = new TreeNodeImpl();
          
           {
           TreeNodeImpl treeNode = new TreeNodeImpl();
           treeNode.setData("Departments");
           _rootNode.addChild(new Integer(1), treeNode);
           }
           {
           TreeNodeImpl treeNode = new TreeNodeImpl();
           treeNode.setData("Resources");
           _rootNode.addChild(new Integer(2), treeNode);
           }
          
           System.out.println("Finished loading KM Tree ...");
           }
          
           public void processSelection(NodeSelectedEvent event) {
           }
          
          }
          


          When I click on the "Report" tab it does not render.

          RichFaces Version: 3.3.0
          Server: WebLogic 10
          Browser: IE and FireFox

          Any kind of help is appreciated.

          Thanks,
          -saurav

          • 2. Re: TabPanel of switchType=
            Ilya Shaikovsky Master

            checked and works under latest richfaces-demo snapshot.

            if it works with switchMode=server? Try to update RF.

            • 3. Re: TabPanel of switchType=
              Saurav Biswas Newbie

              Where can I download the "ricfaces-demo snapshot"?

              And it is working with switchType="server".

              Thanks,
              -saurav

              • 4. Re: TabPanel of switchType=
                Ilya Shaikovsky Master

                follow the link in my signature. There you fined the link to download the demo sources.

                • 5. Re: TabPanel of switchType=
                  Saurav Biswas Newbie

                  Hi Ilya,

                  I figured out the issue. It had to do with WebLogic. To use JSF on WebLogic you have to use the JSF library that comes with WebLogic.

                  When I took the same application and deployed in Tomcat everything worked fine. Then I noticed that there is a difference in the JSF version being used between WebLogic and Tomcat. So I upgraded the JSF library on WebLogic to 1.2_09 (shows as 1.2_09-b02-FCS on the console). And everything worked.

                  So anyone using WebLogic make sure that you upgrade to the latest version of JSF or atleast 1.2_09. Just removed the jars in jsf-1.2.war and replace them with the new ones.

                  Thanks,
                  -saurav