3 Replies Latest reply on Sep 24, 2011 2:08 PM by ilya_shaikovsky

    RichFaces 4: how to pass clicked row to managed bean?

    ma.aqcon

      Hi all,

       

      I am currently migrating a RF 3.3.3 JSF 1.2 application to RF 4 and JSF 2.x.

       

      In 3.3.3 I am using the following code to pass the clicked row object to the managed bean

       

      <rich:dataTable binding="#{general.dataTable}" value="#{general.rows}" var="row" id="table">
          <a4j:support event="onRowClick" reRender="toggle" action="#{general.loadObject}">
              <f:setPropertyActionListener target="#{general.object}" value="#{row}"/>
          </a4j:support>
      </rich:dataTable>
      

       

      As a4j:support is removed in RF4 we need an alternative approach for this construct. I tried to build something with a4j:ajax or f:ajax but both do not fire an ajax event rowclick/onrowclick. I also tried to use a4j:jsFunction. But as I need the #{row} var I have to put this into the <rich:dataTable></rich:dataTable> and the jsFunction within is not found.

       

      Does anybody know how to do this?

       

      Many thanks in advance!

       

      Regards,

      Michael