1 Reply Latest reply on Jul 31, 2011 2:54 PM by Ivan Costa

    Richfaces 3.3.3 dataTable onRowClick don't work after scrolling

    Ivan Costa Newbie

      Hi all,

       

      I want to call a action by clicking on a datatable row. I used a4j:support event="onRowClick" but it's  working ONLY on datatable's first page. If I scroll to the second page, the action isn't called.

       

      Code:

       

      <rich:dataTable id="datatable1"

                          value="#{buscaPessoa.pessoas}"

                          rows="10"

                          width="100%"

                          onRowMouseOver="this.style.backgroundColor='#F1F1F1'"

                          onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

                          var="item" >

       

           <a4j:support event="onRowClick" action="#{buscaPessoa.editar}" >

               <f:param name="idPessoaEscolhida" value="#{item.id}" >

               </f:param>

           </a4j:support>

       

      </rich:dataTable>

       

      <rich:datascroller for="datatable1" />

       

       

      Backing bean using

      @RequestScoped

      @KeepAlive

       

       

      Why the action isn't called when I'm viewing the second page after scrolling?

      Thanks in advance

      Ivan

        • 1. Re: Richfaces 3.3.3 dataTable onRowClick don't work after scrolling
          Ivan Costa Newbie

          Well, a4j:support didn't help me, so I used a function with a4j:jsFunction and it worked fine.

           

          <a4j:jsFunction name="cliqueLinha" action="#{buscaPessoa.editar}">

              <f:param name="idPessoaEscolhida" >

              </f:param>

          </a4j:jsFunction>

           

           

          <rich:dataTable id="datatable1"

              value="#{buscaPessoa.pessoas}"

              rows="10"

              width="100%"

              onRowMouseOver="this.style.backgroundColor='#F1F1F1'"

              onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"

              onRowClick="cliqueLinha('#{item.id}');"

              var="item" >