1 Reply Latest reply on Mar 1, 2011 3:00 PM by psramkumar.ps.ramkumar.gmail.com

    DataExtendedTable et @DataModelSelection

    philippeaubertin

      Hi,


      I have an issue with this annotation:@DataModelSelection


      The @DataModelSelection is correctly populate with the correct object, but if I try to change order or filter by columns then the @DataModelSelection always return the first row. I tried everything found on the net but I can't figure out a solution.


      Is anybody have a solution?


      Thanks, It's a major issue for me.


      Best regards,


      Aubertinp


      Here is the code below:



      @DataModel
      private List<Handicap> mlisteResultat;
      
      @DataModelSelection("mlisteResultat")
      @Out(required = false)
      private Handicap mHandicap;



      and the jsf:



      <rich:extendedDataTable var="handicap" value="#{mlisteResultat}"
                     id="tableContacts" width="880px" height="350px"
                     selectedClass="dataTableSelectedRow" sortMode="single"
                     selectionMode="single" 
                     
                     onRowMouseOver="this.style.backgroundColor='#eaf0f8'"
                     onRowMouseOut="this.style.backgroundColor='#{a4jSkin.rowBackgroundColor}'"
                     onRowClick="this.style.backgroundColor='#cfddef'" rows="13"
                     reRender="scrollercontact"
                     >
      
                     <rich:column id="col_1_handicap" sortable="true"
                          sortBy="#{handicap.idHandicap}" filterBy="#{handicap.idHandicap}"
                           width="70px">
                          <f:facet name="header">
                               <h:outputText value="ID" />
                          </f:facet>
                          <h:outputText value="#{handicap.idHandicap}" />
                     </rich:column>
      
                     <rich:column id="col_2_handicap" sortable="true"
                          sortBy="#{handicap.dateCreationHandicap}"
                          filterBy="#{handicap.dateCreationHandicap}" 
                          width="200px">
                          <f:facet name="header">
                               <h:outputText value="Date de création" />
                          </f:facet>
                          <h:outputText value="#{handicap.dateCreationHandicap}" />
                     </rich:column>
      
                     <rich:column id="col_3_handicap" sortable="true"
                          sortBy="#{handicap.nomHandicap}" filterBy="#{handicap.nomHandicap}"
                           width="200px">
                          <f:facet name="header">
                               <h:outputText value="Candidat" />
                          </f:facet>
                          <h:outputText value="#{handicap.nomHandicap} " />
                          <h:outputText value=" #{handicap.prenomHandicap}" />
                     </rich:column>
      
                     <rich:column id="col_4_handicap" width="200px">
                          <f:facet name="header">
                               <h:outputText value="Etat" />
                          </f:facet>
                          <h:outputText value="#{handicap.actifHandicap}" />
                          
                          
                     </rich:column>
      
                     <rich:column id="col_5_handicap" width="200px">
                          <f:facet name="header">
                               <h:outputText value="Actions" />
                          </f:facet>
                          <a:commandButton value="Changer" reRender="tableContacts"
                               action="#{handicapBean.changeState}" style="width:20px"
                               image="/img/items/refresh.png" />
                          
                          <a:commandButton value="Afficher" reRender="viewHandicapPanel"
                               process="viewHandicap"
                               action="#{handicapBean.selectHandicap}"
                               image="/img/items/consult.png"
                               oncomplete="javascript:Richfaces.showModalPanel('viewHandicapPanel');" />
      
                          <a:commandButton value="Editer" reRender="editContactPanel"
                               process="detailHandicap"
                               action="#{handicapBean.selectHandicap}"
                               image="/img/items/modify.png"
                               oncomplete="javascript:Richfaces.showModalPanel('editContactPanel');" />
      
                          <a:commandButton value="Delete" reRender="tableContacts"
                               action="#{handicapBean.deleteHandicap}"
                               image="/img/items/listeFormuleHide.png" />
                     </rich:column>
      
      
                </rich:extendedDataTable>