3 Replies Latest reply on Aug 7, 2012 7:28 AM by iabughosh

    datatable and object parameter

    ugossi

      Hi all, i've a problem using dataTable and passing object parameter.

      I'm able to do this wint RF 3.

      I'm using RF 4, jsf 2 e jpa2 on glassfish.

      I read some post on this argument but i can't find a solution.

       

      I'm able to pass a single value, like in the code below, but i'd like to pass an objet, containing all the data in the row, to the backing bean for optimize my code.

       

      <rich:panel header="ANAGRAFICA" styleClass="top">

        <a4j:jsFunction name="show" action="#{anagraficaBB.trovaDtlAnalisi}" render="tabellaAnalisiDett,modanag,tabellaAnagrafica">

         <a4j:param name="id" assignTo="#{anagraficaBB.idAnagrafica}" />

        </a4j:jsFunction>

      <center>

      <h:panelGrid columns="2" id="pannello" columnClasses="column1,column2" width="75%" styleClass="align_top" border="1"> 

       

          <h:panelGrid columns="1" id="pannelloAnagrafica">

        

          <rich:dataTable id="tabellaAnagrafica" value="#{anagraficaBB.listAnagraficaObj}" rows="9" var="anag" 

              onrowdblclick="show(#{anag.tab.id})">

      ....

       

      Someone can help me?

      Thank you.

      Best regards to all.

        • 1. Re: datatable and object parameter
          iabughosh

          hello rossi,

          i think you can't pass an object to a4j:jsFunction, i opened a discussion about this long ago, you can only pass parameters supported by java script (int, string, char ...), because a4j:jsFunction is in the end a javascript function.

           

          regards.

          • 2. Re: datatable and object parameter
            ugossi

            Hi Ibrahim , thanks a lot.

            Do you know any other method for passing object parameter on an event in a datatable?

            In RF 3  was possible and for me is really usefull.

            Tks!

            • 3. Re: datatable and object parameter
              iabughosh

              i usually use a4j:commandLink or commandButton with f:setPropertyActionListener to pass objects, but in your case (rowdblclick) i think you can pass the id and get the details like you did.

               

              regards.