• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to set a variable globally in JSF?  RSS feed

 
Raghu Sha
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have a datatable with id= tblId#{emp.id}
<c:set var="tableID" value="tblId#{emp.id}">
displaying employee details inside c:forEach
closing dataTable.


Inside validate method,always i am getting last table row id only.

For ex.
Dispaying 5 table dynamically.
Need to validate check box selected or not.
5 table are displayed.
But it shows 5th table row id only.
It is because of local varible declaration?
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have a number of problems.

First, you are defining an element id attribute using an EL expression. Not all attributes can be defined in EL. Some, such as the id attribute require a fixed value.

Secondly, you're attempting to use JSTL in JSF. I realize that Oracle has published some samples that do that, but in reality JSF and JSTL do not co-exist at all well. In any event, almost anything that you could do with JSTL can be done in native JSF and done more reliably.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!