2 Replies Latest reply on Sep 24, 2010 10:44 AM by satyakatti

    Doubt with search functionality of rich:extendedDataTable

    satyakatti

      Hi All,

       

      I have a rich:extendedDataTable with 7 columns and search is enabled on the 1st column.

       

      The search functionality works fine on the column also.

       

      But I also have double click functionaloty on the same table i.e i double click on the row and that row gets deleted from the table.

       

      Now the problem is

           1. I do searching on the table,

           2. I double click on 1st row

           3. Wrong row gets deleted. i.e 1st row which appears before doing search is getting deleted but not the one actually displayed.

       

      Ex: I have 26 rows from "A to Z" before search and 0th is A and 1st row is "B" etc ...

           I search by character "D" and one row is displayed in the table.

           Double click that row, but A gets deleted because selected row index is "zero" and before filter zeroth row was "A".

           "A" gets deleted but row "D" is still shown because of filter criteria. Again double click on the row, "B" gets deleted because "B" is at zeroh

           position (A is already deleted in last trial).

       

      So is there any way that I filter the dataTable and do a selection on the table to ge the exact object?

       

      Here is the code for that:

       

           <rich:extendedDataTable id="idChannelsExtTable"
                      width="1000px" height="600px" style="border: 1px 0px 1px 0px;"
                      value="#{channelsBean.channelsList}"
                      selection="#{channelsBean.selection}"
                      var="channelAttr" sortMode="single"
                      selectionMode="single">

       

                      <rich:column sortable="false" label="Name" width="250px" filterBy="#{channelAttr.name}" filterEvent="onchange">
                          <f:facet name="header">
                              <h:outputText value="Name" />
                          </f:facet>
                          <h:outputText value="#{channelAttr.name}" />
                      </rich:column>

       

                     <a4j:support event="ondblclick"
                          onsubmit="#{rich:component('panel')}.show()" oncomplete="#{rich:component('panel')}.hide()"
                          requestDelay="500" action="#{channelsBean.addChannelsToCart}" ajaxSingle="true"
                          reRender="idChannelsExtTable, idShopingCartPanel" />
                  </rich:extendedDataTable>

       

      Regards,

      Satya