1 Reply Latest reply on Jun 1, 2009 3:45 AM by nbelaevski

    need help getting two of the examples working from livedemo

      FIrst problem:

      From the following code I have a question:

      <rich:tree id="treeXML" value="#{stations.data}" var="vardata">
       <rich:treeNode>
       <h:outputText value="#{vardata.attributes['name']}" />
       <h:outputText value="#{vardata.attributes['date']}" />
       <h:outputText value="#{vardata.attributes['time']}" />
       <h:outputText value=" #{vardata.text}" />
       </rich:treeNode>
      </rich:tree>
      ...


      In the line <h:outputText value="#{vardata.attributes['name']}" /> is vardata referring to a managed bean you need to define, or is it referring to var="vardata"
      Either way I am having trouble getting this to work. I used the exact code that is given, and I created an xml file that I put in the same fodler as my page. I mean I am almost sure I am doing everything correct here. I just don't know what to make of vardata. SO is it a managed bean? It seems to me if it were a managed bean that managed bean would need to be linking to the xml file, but I could not make that work.


      Second problem:

      Here I am having the exact same question as from above, except it refers to items here instead of vardata. I am also having asecond problem with this code though as well, read below the code to see the question:

      <h:form>
       <rich:tree style="width:300px" switchType="ajax" stateAdvisor="#{treeDemoStateAdvisor}">
       <rich:recursiveTreeNodesAdaptor roots="#{fileSystemBean.sourceRoots}" var="item" nodes="#{item.nodes}" />
       </rich:tree>
       </h:form>
      


      Is the line stateAdvisor="#{treeDemoStateAdvisor}"> referring to a managed bean too? What exactly is treeDemoStateAdvisor referring to here? I know there is java code that goes with this called TreeDemoStateAdvisor.java, but I did create that class with the included java code and it doesnt seem to work for me. Do I need a managed bean called TreeDemoStateAdvisor, or is this line supposed to know it is referring to the entire TreeDemoStateAdvisor.java class? If someone could explain this concept to me it might help because I have only seen EL expressions that have something separated by a period, for instance {bean.javaCode}
      The concept of somethign like {treeDemoStateAdvisor} by itself is new to me


      Thanks, as usual for the great and fast help this site gives