You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by marek__222 <pa...@op.pl> on 2006/07/05 21:56:35 UTC
Passing parameters to managed bean in a loop
Hello
I have a list of art works in a gallery. Everybody can see all works
(admireWork action), but only an author of a specified work is allowed to
edit it (editWork action). I want the [edit] link to appear only for the
authors, next to their works. I'm using rendered="#{workBean.allowEdit}, and
the problem is this: How can I let the workBean know, which work is now
being iterated? Can I pass a parameter to workBean every iteration, so it
can make a decision? I'm new to JSF and I don't really know how this should
be handled. Help would be appreciated.
<h:dataTable value="#{workBean.works}" var="w">
<h:column>
<h:commandLink id="link" action="admireWork" value="#{w.name}">
<t:updateActionListener property="#{workBean.work}" value="#{w}"/>
</h:commandLink>
<h:commandLink id="linkEdit" action="editWork" value="[edit]"
rendered="#{workBean.allowEdit}">
<t:updateActionListener property="#{submitFileBean.work}"
value="#{w}"/>
</h:commandLink>
</h:column>
<h:column>
...
</h:column>
</h:dataTable>
--
View this message in context: http://www.nabble.com/Passing-parameters-to-managed-bean-in-a-loop-tf1896905.html#a5188626
Sent from the MyFaces - Users forum at Nabble.com.