This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSF and the fly likes Repeating JSF code Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Repeating JSF code" Watch "Repeating JSF code" New topic

Repeating JSF code

André Campanini

Joined: Jun 20, 2008
Posts: 19
Hi, everybody.

I want to repeat this code in my page for any page I have:

<h:commandLink action="#{cliente.selectNumberPage}" value="1">
<f:param name="jsfcrud.chosenPage" value="0"/>

For example, for a list with 3 pages, it would be:

<h:commandLink action="#{cliente.selectNumberPage}" value="1">
<f:param name="jsfcrud.chosenPage" value="1"/>
<h:commandLink action="#{cliente.selectNumberPage}" value="2">
<f:param name="jsfcrud.chosenPage" value="2"/>
<h:commandLink action="#{cliente.selectNumberPage}" value="3">
<f:param name="jsfcrud.chosenPage" value="3"/>

I've tried with "c:forEach", but JSF doesn't recognize the variable when it's "loading" the page.

Does everybody knows a way to do that in a good practice way?
I agree. Here's the link:
subject: Repeating JSF code
It's not a secret anymore!