What implementation and version of JSF are you using? This was a known bug in 1.0 and should be fixed in the latest version.

Take a look at this:

http://forum.java.sun.com/thread.jspa?forumID=427&threadID=534232


----- Original Message ----- From: "Ergun Mihcioglu" <[EMAIL PROTECTED]>
To: "MyFaces Discussion" <users@myfaces.apache.org>
Sent: Tuesday, July 05, 2005 9:41 AM
Subject: h:commandLink and h:dataTable multiple calls


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


Reply via email to