2 Replies Latest reply on Sep 30, 2013 3:52 AM by kineas

    commandLink in Datatable in List : bug ?

    kineas

      Hi,

      I have an issue in my code and I can't understand why.

       

      Here is my code :

      <h:panelGrid id="panelDetailAccesId" width="100%">
        <rich:list var="detailAccess" value="#{utilmanBean.listDetailsAccesses}" iterationStatusVar="st" type="#{commonBean.listTypeDefinitions}" rowClass="listRowClass">
          <h:panelGrid id="subPanelDetailAccessId" columns="2" width="100%" styleClass="panelDetailAccess" columnClasses="panelDetailAccess1,panelDetailAccess2">
            <rich:dataTable value="#{detailAccess.listAccesses}" var="access" rows="10"/>
              <rich:column>
                <f:facet name="header">
                  <h:outputText value="#{AM['label.corporation']}"/>
                </f:facet>
                <h:inputText value="#{access.corporation}" size="12"/>
              </rich:column>
              ...
              <rich:column>
                <f:facet name="header">
                  <h:outputText value="#{AM['label.action']}"/>
                </f:facet>
                <a4j:commandLink action="#{utilmanController.deleteAccess}" render="@body,@footer" execute="@this" status="void">
                  <h:graphicImage library="common" name="img/delete.png" styleClass="img-link"/>
                  <f:setPropertyActionListener target="#{utilmanBean.currentAccess}" value="#{access}"/>
                </a4j:commandLink>
              </rich:column>
              <f:facet name="footer">
                <rich:dataScroller/>
              </f:facet>
            </rich:dataTable>
      
            <a4j:commandLink action="#{utilmanController.deleteDetailAccess}" render="panelDetailAccesId" execute="@this" status="void">
              <h:graphicImage library="common" name="img/delete.png" styleClass="img-link-big"/>
              <f:setPropertyActionListener target="#{utilmanBean.currentDetailAccess}" value="#{detailAccess}"/>
            </a4j:commandLink>
          </h:panelGrid>
        </rich:list>
      </h:panelGrid>
      
      
      
      

       

      So, it works when I am on the first page of the datatable but when I change the page the button don't work anymore and I don't understand why.

      Can you help me on this ?

       

      (I try without the rich:list and it works. I try with ui:repeat and a4j:repeat but there is some strange behavior with these...)

        • 1. Re: commandLink in Datatable in List : bug ?
          bleathem

          Tell us about your environment:

          1. Version of RichFaces
          2. Implementations of JSF and version (eg. Mojarra or MyFaces? What version?)
          3. What container? (JBoss EAP? Wildfly? Tomcat?)

           

          Are any errors reported?

          1. Check the console log of your Browser
          2. Check your server log

           

          Try using a4j:log to gain some insight into the network communication.  Post the results of a4j:log here for help with the analysis. 

          (For detailed instructions on collecting this log information see: https://gist.github.com/lfryc/6123495)

          • 2. Re: commandLink in Datatable in List : bug ?
            kineas

            Hi,

            I finally find a way to make it works. I try to use the "c:foreach" component instead of "rich:list" and it solves the problem ! (I just had to handle the Id manually)

             

            But for information here is my environment :

            1 - Richfaces 4.3.4.Final

            2 - JSF 2.1.19

            3 - Tomcat 6.0.36