2 Replies Latest reply on Oct 10, 2007 5:36 PM by parki

    Question about looping in JSF

    parki

      Hello.

      Bit of a newbie question, this, but hoping someone can help out.

      Let's say I have a List objects and each Foo has a 'name' and 'description' attribute. I can dump this information in a table easily:

      <h:dataTable value="#{foobars.all}" var="f">
      <h:column>
      <h:outputText value="#{f.name} #{f.description}"></h:outputText>
      </h:column>
      </h:dataTable>

      The above works great. I'm a bit stumped on the best way to output the same information in a rich panel bar. I want to achieve something like:

      <rich:panelBar value="#{foobars.all}" var="f">
      <rich:panelBarItem label="#{f.name}">#{f.description}</rich:panelBarItem>
      </rich:panelBar>

      but this doesn't work. In the case of the dataTable, it implicitly loops over the values in the 'value' attribute, but no such luck with panelBar.

      I guess I need to do the looping in JSP-speak, but wondering what the "proper" way would be to do something like this.

      Any help is appreciated.

      Cheers,

      parki...