Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Repeating JSF code  RSS feed

 
André Campanini
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"/>
</h:commandLink> 

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> 
<h:commandLink action="#{cliente.selectNumberPage}" value="2">
<f:param name="jsfcrud.chosenPage" value="2"/>
</h:commandLink> 
<h:commandLink action="#{cliente.selectNumberPage}" value="3">
<f:param name="jsfcrud.chosenPage" value="3"/>
</h:commandLink> 

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?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!