6 Replies Latest reply on Jul 11, 2012 5:11 AM by sabarinathsss

    Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)

    sabarinathsss

      Hi

       

      i m using a4j:commandLink in rich:dataTable , in a4j:commandLink tried to show the popup panel (rich:popupPanel).

       

      Page:

       

      <rich:dataTable value="#{sample.dataDetail.dataList}"   id="sampletable" var="result" rows="6"    reRender="sampletableScroller">

        

      <rich:column>
          <f:facet name="header">
           <h:outputText value=" Name" styleClass="columnhead" />
          </f:facet>


          <a4j:commandLink value="#{result.get('Name')}"  execute="@this" onbeforedomupdate="#{rich:component('richPanel')}.show()" action="#{sampleManagedBean.getDetails}" render="sampleGrid">
        

        <a4j:param value="#{result.get('Object::Agency::BoredeauImport::AgencyId')}" assignTo="#{AgencyManagedBean.agencyId}" />
           <a4j:param value="14" assignTo="#{AgencyManagedBean.ownerId}" />
          </a4j:commandLink>
         </rich:column>

       

      <f:facet name="footer">

          <rich:dataScroller boundaryControls="auto" fastControls="auto" stepControls="auto" id="sampletableScroller"></rich:dataScroller>

         </f:facet>

        </rich:dataTable>

       

      It generates number of rows .The link(a4j:commandLink) in the first row only show the popup.when i m clicking the second row link its not show the popup.After that other links and pagination also not worked.

       

      Popup used:

       

      <rich:popupPanel id="richPanel" autosized="true" rendered="true" header="Details">

         <f:facet name="controls">

          <h:outputLink value="#" onclick="#{rich:component('richPanel')}.hide(); return false;">

                          X

          </h:outputLink>

         </f:facet>

         <h:panelGrid id="sampleGrid" columns="2" frame="box"  rules="all">

         <h:outputText value="Name " styleClass="columnhead" /><h:outputText value="#{sampeManagedBean.dataDetail.dataList.get(0).get('Name')}" />

        <h:outputText value="Phone " styleClass="columnhead" /><h:outputText value="#{AgencyManagedBean.dataDetail.dataList.get(0).get('Phone')}" />

        

       

      <a4j:commandButton value="Cancel" onclick="#{rich:component('richPanel')}.hide();"></a4j:commandButton>

         </h:panelGrid>

        </rich:popupPanel>

        • 1. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
          iabughosh

          Hello Selvaraj,

          try showing/hiding popup using oncomplete event instead of onclick and onbeforedomupdate.

           

          regards.

          1 of 1 people found this helpful
          • 2. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
            sabarinathsss

            Hi Ibrahim Abu Ghosh,

             

            Thanks for reply.

             

            Regards.

            • 3. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
              sabarinathsss

              Hi

               

                      Now I m trying to use oncomplete event instead of onclick and onbeforedomupdate.

               

              I m used a4j:commandLink in two columns of rich:dataTable.Now also the link(a4j:commandLink) in the first row only show the popup.when i m clicking the second row link its not show the popup.After that other links and pagination also not worked.

               

              Page :

               

              <rich:dataTable value="#{SampleBean.dataDetail.dataList}"var="result" rows="15"   reRender="SampletableScroller">

               

                          <rich:column>

               

                              <f:facet name="header">

               

                                  <h:outputText value="Name" styleClass="columnhead" />

               

                              </f:facet>

               

                              <a4j:commandLink value="#{result.get('Name')}"  onclick="getDetails(#{result.get('Object::Id')},14)">

                              </a4j:commandLink>

               

                             </rich:column>

                            <rich:column>

                              <f:facet name="header">

                                  <h:outputText value="Passed Success Imports" styleClass="columnhead" />

                              </f:facet>

               

                              <a4j:commandLink value="View" oncomplete="#{rich:component('SuccessFileListPanel')}.show()" action="#{ManagedBean.getAgencyImportFileList}" render="Grid">

               

                                  <a4j:param value="#{result.get('Object::Id')}" assignTo="#{ManagedBean.Id}" />

               

                                  <a4j:param value="14" assignTo="#{ManagedBean.ownerId}" />

               

                                  <a4j:param value="Success" assignTo="#{ManagedBean.Status}" />

               

                              </a4j:commandLink>

                          </rich:column>

               

                          <f:facet name="footer">

               

                              <rich:dataScroller boundaryControls="auto" fastControls="auto" stepControls="auto" id="SampletableScroller"></rich:dataScroller>

               

                          </f:facet>

               

                      </rich:dataTable>

               

                      <a4j:jsFunction id="agencyDetails" name="getDetails"   oncomplete="#{rich:component('DetailsPanel')}.show()" action="#{SampleBean.getDetails}" render="DetailsGrid">

               

                          <a4j:param name="param1" assignTo="#{SampleBean.Id}"/>

               

                          <a4j:param name="param2" assignTo="#{SampleBean.ownerId}"/>

               

                      </a4j:jsFunction>

               

              Thanks in Advance.

              • 4. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
                iabughosh

                i think you need to put your popup panel inside your rich:column.

                • 5. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
                  sivaprasad9394

                  <a4j:commandLink  value="#{result.get('Name')}"  execute="@this" onbeforedomupdate="#{rich:component('richPanel')}.show()"

                  action="#{sampleManagedBean.getDetails}" render="modelPanelID,datatable id,datascroller id">

                   

                  Try adding modelpanel out side the form tag and add h:form inside the model panel.

                  • 6. Re: Using a4j:commandLink in rich:dataTable (richfaces 4.2.2)
                    sabarinathsss

                    Hi

                     

                    Thanks for reply

                     

                    Regards

                    Sabarinath S