4 Replies Latest reply on Nov 17, 2008 5:30 AM by Piotr Buda

    ExtendedDataTable - multiple onselectionchange events

    Ingo Jobling Master

      Hello,

      I am using ExtendedDataTable from nightly snapshot 3.3.0-20081014.041253

      When I click on a row, it generates an onselectionchange event, as expected. However, any interaction at all with the selectedrow generates more onselectionchange events.

      For example:

      - Click on a row which is already selected : generates onselectionchange event.

      - Double click a row : generates 2 onselectionchange events.

      - Choose a value from a h:selectOneMenu which is on a selected row : generates 2 onselectionchangeevents.

      Since I am rerendering a child table during the onselectionchange event (using a4j:support), all of these redundant events make the user interaction slow. Am I doing something wrong? Any help would be greatly appreciated!

      <h:form id="productionsForm">
      
       <rich:extendedDataTable id="productionsTable"
       value="#{productionListController.resultList}" var="production"
       height="#{productionListController.tableHeight}px"
       onRowMouseOver="this.style.backgroundColor='#{a4jSkin.additionalBackgroundColor}'"
       onRowMouseOut="this.style.backgroundColor=''"
       selectionMode="single"
       selection="#{productionListController.selection}"
       selectedClass="rich-sdt-row-selected"
       rowClasses="rvgRowOne,rvgRowTwo"
       >
       <a4j:support event="onselectionchange"
       ajaxSingle="true" action="#{productionListController.onSelectionChange()}"
       reRender="commonFramesDiv" limitToList="true" />
      
       <rich:column width="150px">
      
       <f:facet name="header">#{messages['org.agritrace.ProductionType']} <span class="required">*</span></f:facet>
      
       <s:decorate template="/layout/editTd.xhtml">
       <h:selectOneMenu id="productionTypeSelect" value="#{production.type}" binding="#{productionInputs.getInputMap().type}"
       required="true" styleClass="tableInput" label="#{messages['org.agritrace.ProductionType']}" >
       <s:selectItems value="#{productionTypeList.resultList}"
       var="productionType"
       label="#{messages[productionType.resourceKey]}"
       noSelectionLabel="#{production.isEmpty() ? messages['org.agritrace.New']:null}" />
       </h:selectOneMenu>
       </s:decorate>
      
       </rich:column>
      
       <rich:column width="150px">
      
       <f:facet name="header">#{messages['org.agritrace.Species']} <span class="required">*</span></f:facet>
      
       <s:decorate template="/layout/editTd.xhtml">
       <h:selectOneMenu id="speciesSelect" value="#{production.species}" binding="#{productionInputs.getInputMap().species}"
       required="true" styleClass="tableInput" label="#{messages['org.agritrace.productionSpecies']}">
       <s:selectItems value="#{speciesList.resultList}" var="species"
       label="#{messages[species.resourceKey]}"
       noSelectionLabel="#{messages['org.agritrace.PleaseSelect']}" />
       </h:selectOneMenu>
       </s:decorate>
      
       </rich:column>
      
       </rich:extendedDataTable>
      
      </h:form>