6 Replies Latest reply on Jan 1, 2011 8:36 PM by otherox

    RichFaces tree not rendering children, nor treeNode, nor treeNodesAdaptor, NONE

    otherox

      Hello everyone

       

      [I'm new in the forum, I would appreciate if you are pacient if I violate any rule or this post is misplaced]

       

      I've been trying to make this richfaces tree and I'm facing a big problem. Not a singe child is rendered in the HTML output. Not the children I make with treeNode, not the ones that should be made with treeNodesAdaptor. The preview in Eclipse shows everything fine and there doesn't seem to be any sintactic or spelling error. Funny thing is that when I click on a link in the main menu of my web app to go to other page, a GlassFish error page is displayed. Those pages would work if I didn't go to the tree page previously.

       

      I'm using Eclipse Elios with RichFaces 3.2.

       

      Here's the code in my web page containing the tree of the not rendered nodes [IMPORTANT can't see the wiki markup code I pasted... what's wrong? ]

       

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

          xmlns:f="http://java.sun.com/jsf/core"

          xmlns:rich="http://richfaces.org/rich"

          xmlns:a="http://richfaces.org/a4j">


      <ui:composition template="../plantillas/principal.xhtml">

          <ui:define name="content">


              <f:loadBundle basename="cadenas.mensajes" var="mensajes" />


              <link

                  href="#{facesContext.externalContext.requestContextPath}/css/estilos.css"

                  rel="styleSheet" type="text/css" />


              <h:panelGrid columns="2"

                  columnClasses="catalogoAdminCol1,catalogoAdminCol2"

                  style="width:100%">

                  <h:panelGroup>

                      <rich:panel style="width:100%; height:400px;">

                          <h:form id="frmArbol">

                              <rich:tree id="arbol">

                                  <rich:treeNode id="nodoArtistas" rendered="true">

                                      <h:outputText value="Artistas" />

                                  </rich:treeNode>

                                  <rich:treeNodesAdaptor nodes="#{administrarCatalogo.artistas}"

                                      var="artista">

                                      <rich:treeNode id="nodoArtista">

                                          <h:outputText value="#{artista.nombre}" />

                                      </rich:treeNode>

                                  </rich:treeNodesAdaptor>

                              </rich:tree>

                          </h:form>

                      </rich:panel>

                  </h:panelGroup>

                  <h:panelGroup>

                      <rich:panel style="width:100%">

                          <f:facet name="header">Artista</f:facet>

                  Y ahora qué

                  </rich:panel>

                  </h:panelGroup>

              </h:panelGrid>


          </ui:define>

      </ui:composition>

       

      When I display this page I don't see any error. I just don't see the tree, as if it doesn't exists. Examining the HTML resulting code I see the frame that is supossed to contain the tree is rendered, but not a single node.

       

      Then, when I decide to click a link on the main menu (part of a template) of a the web app, I get an error page with the following text

       

      HTTP Status 500 -


      type Exception report

      message

      descriptionThe server encountered an internal error () that prevented it from fulfilling this request.

      exception

      javax.servlet.ServletException: In AbstractTreeDataModel rowIndex must be -1.

      root cause

      java.lang.IllegalArgumentException: In AbstractTreeDataModel rowIndex must be -1.

      note The full stack traces of the exception and its root causes are available in the GlassFish Server Open Source Edition 3.0.1 logs.


      GlassFish Server Open Source Edition 3.0.1

       

      I tried not using the nodes adaptor to see if it had something to do with the list iterating or something like that on the bean, but it did not work. Still couldn't see the other node. I've not found much help on the internet, as if the mistake I'm making is something misterious

       

      Thanks in advance

       

      El mensaje fue editado por: Pedro Otero [I manually changed the font of the source code to highlight it]