Arg, mixing JSF and scriptlet? Be prepared for problems, it's like
mixing JSF and JSTL in a JSP :)

The action itself has no way to know which button was used to invoke it.
However, you have various possibilities

1) use a f:param to pass named parameter JSF, you can then query this
parameter from the JSF context
eg:

<h:commandLink action="#{approveBean.action}" styleClass="link">
<f:param name="selectedItemEntry" value="....."/>
<f:verbatim>some link name</f:verbatim>
</h:commandLink>

2) Add a listener to your action, the listener will be called with an
event object which allows you to retrieve the commandLink object user
clicked on.

PS: why do you do the iteration in a scriptlet rather than using a JSF
datatable to iterate of your items?

En l'instant précis du 10/04/07 12:13, shree s'exprimait en ces termes:
> hi all,
> i am displaying various links of tutorials in a JSF page using
> <h:commandLink>.
> what i need to do is,when ever a user clicks a link,i hv to display
> corresponding details of that clicked link in another jsf page.but my
> problem, here is how to pass the value of the clicked one to the bean.
>
> here is the code snippet.
> <%ArrayList values = new ArrayList();
> values = a.getPendingList();
> for ( j = 0; j < values.size(); j = j + 6) {
> %>
> <h:commandLink action="#{approveBean.action}" styleClass="link">
> <f:verbatim><%=values.get(j+1)%></f:verbatim>
> </h:commandLink>
> <%}%>
>
> i want to pass corresponding values(j+1) to the bean .
> i hv been trying to do this since 3 days.
> somebody please help me.
>
> thanks in advance,
> Shree.
>   

Reply via email to