2 Replies Latest reply on Jun 19, 2010 2:06 AM by Martin Dames

    extendedDataTable: takeSelection on row selection

    Martin Dames Newbie

      Hi there,

      I'd like to select a row in my extendedDataTable and to set the selected object in my Action, this should be done with Ajax.

      Here is what I did:

         value="#{personPool}" var="_per" id="table"
          width="280px" height="200px"
          <rich:column sortable="false" label="Flag" id="col_1">
             <f:facet name="header">
                 <h:outputText value="Lastname" id="flag"/>
             <h:outputText value="#{_per.lastName}" id="lastName"/>
         <a:support event="onselectionchange" action="#{myAction.takeSelection(_per)}" reRender="outputPanel" />

      Here is my Action

      @DataModel(scope = ScopeType.PAGE)
           private List<Person> personPool;
      public void takeSelection(Person person1) {

      This does not work! I will get a null value passed to takeSelection.

      If Im adding a third column with a link, e.g.:

      <rich:column sortable="false" label="Hund" id="col_3">
         <f:facet name="header">
           <h:outputText value="Select" id="flag2"/>
         <s:link id="view1Hotel" value="View Person">
              <a:support event="onclick" action="#{doiAction.takeSelection(_per)}" reRender="outputPanel, firstNameInput, secondNameInput, lastNameInput, titleInput, emailInput, telephoneInput, faxInput, institutesInput" />

      it will work, but that is not what my client want. I need a way to select just the row, display the person values, etc.

      Thank you for advice!