Hi
I'm using a commandLink in a dataTable. My command links are like these :
<h:column>
<h:panelGroup id="disable_enable_group" >
<h:commandLink id="disable_link"
action="#{CategoryBean.disable}" immediate="true"
rendered="#{category.status.name=='ACTIVE'}">
<h:outputText value="#{msg.category_disable_link}"/>
<f:param name="uid" value="#{category.uid}"/>
</h:commandLink>
<h:commandLink id="enable_link"
action="#{CategoryBean.enable}" immediate="true"
rendered="#{category.status.name=='PASSIVE'}">
<h:outputText value="#{msg.category_enable_link}"/>
<f:param name="uid" value="#{category.uid}"/>
</h:commandLink>
</h:panelGroup>
</h:column>
This command links are working, but they are calling action methods
multiple times. If there is 4 ACTIVE items in dataTable, and I click
and ACTIVE items link, the action method is called for times.
I get that this is happening because all command links of ACTIVE items
have id 'disable_link' .
I have tried to do something like this
<h:commandLink id="disable_link#{rowNumber}"
action="#{CategoryBean.disable}" immediate="true"
rendered="#{category.status.name=='ACTIVE'}">
to generate ids for every row, but this is not supported I think.
Is there any solution for this multiple calls?
Thanks in advance,
Ergün