2 Replies Latest reply on Mar 2, 2010 6:42 AM by Nick Belaevski

    a4j:commandlink only works fires actionlistener event the first time

    cal kennedy Newbie

      I have an index.jsp that is structured as follows:




                <%@include file="main.jspf"%>



      <div> footer</div>


      main.jspf contains:

      <rich:outerpanel id="opMain">

           <rich:panel id="pnlOne" binding="#{mybean.pnlOne}" rendered="true">

                <%@include file="grid.jsfp">


           <rich:panel id="pnlTwo" binding="#{mybean.pnlTwo}" rendered="false">

                <%@include file="edit.jsfp">





      <subview id="subGrid">

      <rich:dataTable value="#{gridBean.resultset}" var="currentRow">    

                <f:facet name="header">
                          <h:outputText value="Last Update>

                <h:outputText value="#{currentRow.lastUpdate}"/>
                <f:facet name="header">
                      <h:outputText value="Edit"/>
                <a4j:commandLink value="Edit" actionListener="#{gridBean.lnkEditAction}" data="#{currentRow.Id" reRender="opMain"/>





      <subview id="subEdit">

         <h:inputtext id="txtFirstName" binding="#{editBean.FirstName}"/>

         <h:inputtext id="txtLastName" binding="#{editBean.LastName}"/>

         <h:inputtext id="txtPhoneNum" binding="#{editBean.PhoneNum}"/>



      The editBean properties are determined by the record selected in the dataTable by clicking the Edit commandLink.

      The first time the dataTable is renedred pnlOne is rendered.  When the user clicks the Edit link in the datatable pnlOne setRenedred is set to false

      and pnlTwo setrendered = true.

      There is a link at the top of the page that takes the user pack to the grid page (ie. pnlOne rendered = true, pnlTwo rendered = false).

      All of that works fine.  However, after the user is taken back to the grid page the Edit link will not work again.

      The Edit linkcommand only works the first time the site is loaded.


      Any ideas why the Edit linkCommand actionlistener is not being fired after the panels are rerendered a second time?