3 Replies Latest reply on Apr 27, 2011 7:42 AM by Nick Belaevski

    rich:tree doesn't expand

    david swarz Newbie

      Hi,

      I'm using JSF Mojarra 2.0.3 implementation along with Richfaces 4.0.0, so that I can use tree component.

      I have a JSF Eclipse in which I have just added next jars into /WEB_INF/lib/ directory:

      richfaces-components-api-4.0.0.Final.jar

      richfaces-components-ui-4.0.0.Final.jar

      richfaces-core-api-4.0.0.Final.jar

      richfaces-core-impl-4.0.0.Final.jar

      sac-1.3-sources.jar

      cssparser-0.9.5.jar

      guava-r09.jar

       

      I haven't added anything to web.xml nor faces-config.xml files.

       

      I've followed simple tree demo regarding tree component, but I haven't succeded in reproducing the example.

      Tree component doesn't get rendered. The tree elements are display as if it where a list:

      USA

      Columbia

      UK

      DECCA

      Europe

      BMG

      Norway

      WEA

       

      But there are no expand/collpase widgets.

      I'm not sure if there are some kind of incompatibility between Mojarra's implementation and richfaces 4.0.0.

       

       

      Following my xhtml file:

       

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

       

          <ui:composition template="/WEB-INF/templates/appTemplate.xhtml">

              <ui:define name="content">

                  <h:form id="catalogue_list_form">

                      <rich:tree id="tree" nodeType="#{node.type}" var="node" value="#{treeBean.rootNodes}" toggleType="client" selectionType="ajax" selectionChangeListener="#{treeBean.selectionChanged}">

                          <rich:treeNode type="country">#{node.name}</rich:treeNode>

                          <rich:treeNode type="company" icon="/images/tree/disc.gif">#{node.name}</rich:treeNode>

                      </rich:tree>

                  </h:form>

              </ui:define>

          </ui:composition>

      </html>

       

       

      Thanks in advanced,

      David

        • 1. rich:tree doesn't expand
          Nick Belaevski Master

          Hi David,

           

          Likely you are missing h:head/h:body tags defined.

          • 2. rich:tree doesn't expand
            david swarz Newbie

            Hi Nick,

             

            well, in fact I am using a template ( <ui:composition template="/WEB-INF/templates/appTemplate.xhtml"> ). The template it is being used is:

             

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

            <html xmlns="http://www.w3.org/1999/xhtml"

                  xmlns:ui="http://java.sun.com/jsf/facelets"

                  xmlns:h="http://java.sun.com/jsf/html">

                <head>

                  <title>

                      <ui:insert name="title">#{msg.app_title}</ui:insert>

                  </title>

                  <link type="text/css" rel="stylesheet" href="#{resource['css:icatalogo.css']}" />

                </head>

               

                <body>

                    <div id="header">

                        <ui:include src="/WEB-INF/templates/appHeader.xhtml">

                            <ui:param name="user_name" value="#{userBean.name}" />

                            <ui:param name="user_lastname" value="#{userBean.lastname}" />

                            <ui:param name="logout" value="#{msg.logout}" />

                        </ui:include>

                    </div>

                   

                    <center>

                    <div id="main_content">

                        <h:panelGrid id="main_area" columns="2">

                            <ui:fragment>

                                <ui:include src="/WEB-INF/templates/menu.xhtml"/>

                            </ui:fragment>

                            <ui:fragment>

                                <ui:insert name="content">

                                  </ui:insert>

                            </ui:fragment>

                        </h:panelGrid>

                    </div>

                    </center>

                   

                    <div id="footer">

                        <ui:include src="/WEB-INF/templates/footer.xhtml"/>

                    </div>

                </body>

            </html>

             

             

            Anyway, when trying to make rich:tree work, I already used it directly in the template, as it has html and body tags, but I got the same results.

            • 3. rich:tree doesn't expand
              Nick Belaevski Master

              David,

               

              JSF won't render resource dependncies unless you use h:head & h:body.