2 Replies Latest reply on Dec 4, 2008 7:39 AM by bisworks

    extendedDataTable: onselectionchange no longer works after p

    bisworks

      I am using the 3.3.0 BETA2 release and an ExtendedDataTable. When I click on a row a panel is supposed to display the details of the row selected. I am using "a4j:support" on the "onselectionchange" event to re-render the detail area. Here is the code:

      <rich:extendedDataTable
      id="appoTable"
      rows="30"
      value="#{appointmentList.list}"
      var="appointment"
      width="100%"
      height="164px"
      selectedClass="dataTableSelectedRow"
      sortMode="single"
      selectionMode="single"
      rowKeyVar="rkvar"
      selection="#{appointmentList.selection}"
      binding="#{appointmentList.table}"
      onselectionchange="#{event.onselectionchange}">
      <rich:column
      id="ap_patient"
      headerClass="dataTableHeader"

      ...
      ...
      ...

      </rich:column>

      <a4j:support event="onselectionchange"
      immediate="true"
      reRender="appoDetails"
      oncomplete="javascript:alert('onselectionchange WORK!!!');"/>

      </rich:extendedDataTable>

      When I hit the page for the first time everythiung works fine. The detail are is updated as I click on a row in the table.

      If I refresh the page the "onselectionchange" event is no longer triggered. The "alert" box in the "oncomplete" method is not longer seen.

      Is this a know issue? Or is just me seeing it?

      Thanks,
      -saurav

        • 1. Re: extendedDataTable: onselectionchange no longer works aft
          ilya_shaikovsky

          using

           <rich:extendedDataTable value="#{capitalsBean.capitals}" var="cap" id="table"
           width="580px" height="400px" sortMode="#{extendedTableBean.sortMode}"
           selectionMode="#{extendedTableBean.selectionMode}">
           <a4j:support event="onselectionchange" oncomplete="alert(1);"></a4j:support>
          
          


          Support fires the request every time on selection change for me, and after the refreshes - the same.


          And B.t.w. I can't believe that you code can works at all before or after the request because you defined onselectionchange="#{event.onselectionchange}" on the table and uses the same event in the support. This is restricted. Support ignored in such cases if corresponding event attribute defined on the component.

          • 2. Re: extendedDataTable: onselectionchange no longer works aft
            bisworks

            Hi Ilya,

            You are correct. Once I removed the onselectionchange="#{event.onselectionchange}" call it works fine now. I wonder why it works the first time.

            Thank you for the prompt reply.

            Regards,
            -saurav