2 Replies Latest reply on Sep 18, 2012 10:05 AM by Paul Wicher

    RichFaces 4.2.0: how to show data of clicked row using rich:extendedDataTable and popup panel?

    Zaheer Ahmed Novice

      Hi All

      I hope someone can help me. As we could select a row from scrollabledataTable  Richfaces 3.3.3 by using <f:setPropertyActionListener target="#{bean.selectedUser}" /> now in version 4.2.0 it’s <rich:extendedDataTable> and we have to use <a4j:ajax>  with code below the popupPanel displays but empty I have used all the suggested code but I cannot seem to output the selected row’s data.  Can someone help please?

       

       

      <rich:extendedDataTable value="#{whiteBoardAdmin.clientUsers}" selection="#{whiteBoardAdmin.selection}"

                                  selectionMode="single" var="userDetails" >

            

                                        <a4j:ajax execute="@form" event="selectionchange"

                                               listener="#{whiteBoardAdmin.selectionListener}"

                                               oncomplete="#{rich:component('adminPanel')}.show()"

                                               render="adminPanel"  >

                                              

                                        </a4j:ajax>

      ---------------------------------------------------------------------------

      <rich:popupPanel id="adminPanel" domElementAttachment="parent">

      </rich:popupPanel>

      --------------------------------------------------------------------------------------------------------------------------------------

      public void selectionListener(AjaxBehaviorEvent event) {

                     UIExtendedDataTable dataTable = (UIExtendedDataTable) event.getComponent();

                     BasicUserDetail originalKey = (BasicUserDetail)dataTable.getRowKey();

                     selectionItems.clear();

                     for (BasicUserDetail selectionKey : clientUsers) {

                         //dataTable.setRowKey(selectionKey);

                         if (dataTable.isRowAvailable())

                             selectedUser = (BasicUserDetail) dataTable.getRowData();

                         }

                     }

                     dataTable.setRowKey(originalKey);

                 }