1

I have a SEAM JSF web application with a Java back end. I have a list of objects who has a display value which I would like to display. Since the list is retrieved from the DB, it is dynamic

<s:decorate>
  <ui:define name="label">Description:</ui:define>
      <!-- foreach book in bookList -> display the description
  <h:outputText value="#{bean.bookList.book.description}"/>
      -->
</s:decorate>

So in a way I would like to create a sort of foreach loop for labels.

6
  • Which JSF and Seam version? Commented Sep 4, 2013 at 18:59
  • @LuiggiMendoza JSF 2.5, SEAM 2.1. I think Commented Sep 4, 2013 at 19:32
  • 1
    JSF 2.5? You must come from the future since JSF latest version is JSF 2.2.1 Commented Sep 4, 2013 at 19:38
  • @LuiggiMendoza Opps :P I mean JSF 2.0 Commented Sep 4, 2013 at 20:13
  • Then you can use <ui:repeat>. Example: mkyong.com/jsf2/jsf-2-repeat-tag-example Commented Sep 4, 2013 at 20:16

1 Answer 1

8
<ui:repeat value="#{bean.bookList}" var="book">
  <h:outputText value="#{book.description}"/>
</ui:repeat>
Sign up to request clarification or add additional context in comments.

1 Comment

Or #{book.description} directly without using <h:outputText>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.