0 Replies Latest reply on Jul 7, 2009 12:21 PM by Abhinav Jauhri

    a4j:commandLink action not working

    Abhinav Jauhri Newbie

      Hi,

      I am dynamically adding a4j:commandLinks into a table. But the action of the dynamically added commandLink does not work.

      This part get appended each time a value is entered through inputText. Though the row and command links appear but the action doesn't seem to work properly.


      <rich:column>
      <f:facet name="header"> Actions </f:facet>
      <a4j:commandLink rendered="true" value="Remove"
      action="#{hell.removeMember}" />
      <a4j:commandLink value="Mute" action="#{hell.muteMember}" />
      </rich:column>

      The entire "home.xhtml" is attached below.
      Please let me know the problem.

      Thanks.


      <ui:define name="body">
      <h:form>
      <a4j:commandLink id="conference" binding="#{hell.conference}"
      action="#{hell.startConference}" value="Start Conference"
      rendered="true" reRender="conference,addmembers"
      oncomplete="document.getElementById('addmembers').style.display='block'" />

      <rich:panel style="width:620px;">
      <f:facet name="header">
      <h:outputText value="Add conference members" />
      </f:facet>
      <h:panelGrid columns="2">
      <h:outputText value="Name: " />
      <rich:inplaceInput defaultLabel="Enter a conference name" showControls="true" />
      <h:outputText value="Send conference invite to: " />
      <h:inputText id="conferencemember" value="#{hell.member}" />
      <a4j:commandLink id="addmember" action="#{hell.addMemberToConference}" value="Add"
      reRender="conferencemember,memberslist"
      oncomplete="document.getElementById('conferencemember').value=''" />
      </h:panelGrid>
      </rich:panel>
      <rich:simpleTogglePanel
      label="List of users currently in conference" switchType="ajax"
      reRender="memberslist">
      <rich:dataTable id="memberslist" value="#{hell.members}" var="mem">
      <rich:column>
      <f:facet name="header"> Member Name </f:facet>
      <h:outputText value="#{mem}" />
      </rich:column>
      <rich:column>
      <f:facet name="header"> Actions </f:facet>
      <a4j:commandLink rendered="true" value="Remove"
      action="#{hell.removeMember}" />
      <a4j:commandLink value="Mute" action="#{hell.muteMember}" />
      </rich:column>
      </rich:dataTable>
      </rich:simpleTogglePanel>

      </h:form>
      </ui:define>