0

I want to create a jsf-page which is "created" several times. The page's content should be different each time and I want to do this, by passing a bean to the page. That bean should be the bean to load the content from. The bean is allways of the same type.

The jsf main page should go through a list of a bean and creating a link to the same content page for each entry of the list. (and passing the listentry to the page, as said before)

The logic should be sth like that (i know that content="#{content}" won't work, but just that you see what i mean):

<ui:repeat var="content" value="#{bean.contentlist}">
        <a href="#{content.url}" content="#{content}" > #{content.name} </a>
</ui:repeat>

and in the content page

<h1>You are at #{content.name} page</h1>
<ui:repeat var="article" value="#{content.articlelist}">
        <h2>#{article.h1}</h2>
        <p>#{article.text}</p>
</ui:repeat>

here's how the main page should look like:

link to content page 1

link to content page 2

...

Armin
  • 351
  • 1
  • 4
  • 29
  • 2
    Is there any reason you don't pass some kind of ID via URL param and read the appropriate entity on load via the ID? – Smutje Jun 18 '15 at 18:28
  • @Smutje no, i havn't thought about that, this should work. simple and easy - I should have thought about that myself... – Armin Jun 18 '15 at 18:34

0 Answers0