This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JSF and the fly likes problem with c:forEach and links Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » JSF
Bookmark "problem with c:forEach and links" Watch "problem with c:forEach and links" New topic

problem with c:forEach and links

eve agostini
Ranch Hand

Joined: Nov 01, 2005
Posts: 43
i have some product displayed with the <c:forEach> tag (of jstl..i didn't find an equivalent in jsf). I would like to display a link near each one, the link is a h:commandLink which is linked with a method in the backing bean. What i can't understand is how to know (in the method) which link has been clicked.

here is the code:

[ January 12, 2006: Message edited by: eve agostini ]
Bagwan Mehrat
Ranch Hand

Joined: Jan 26, 2002
Posts: 119
Originally posted by eve agostini:

If I remember correctly, in JSF you can't put JSF components like commandlink inside loops like JSTL forEach. It's an annoying limitation but JSF provides dataTable which can be used to get around that problem somewhat.
eve agostini
Ranch Hand

Joined: Nov 01, 2005
Posts: 43
thanks i solved with datatable
It is sorta covered in the JavaRanch Style Guide.
subject: problem with c:forEach and links