3 Replies Latest reply on Jun 1, 2006 9:36 AM by Gerd Michalke

    Multiple datamodel in one bean

    Gerd Michalke Newbie

      Hi,

      Here is my bean code

      @DataModel(value="searchResults")
      List searchResults;


      @DataModelSelection(value="qstChoisi")
      private Questionnaire qstChoisi;

      @DataModel(value="questionnairesChoisis")
      private List questionnairesChoisis;

      <h:dataTable value="#{searchResults}"
      var="msg"
      styleClass="dvdtable"
      headerClass="dvdtablehead"
      rowClasses="results"
      columnClasses="dvdtablecol">

      <h:column>
      <f:facet name="header">
      <h:outputText value="#{msgs.rechercheQuestionnaireSel}" />
      </f:facet>
      <h:selectBooleanCheckbox value="#{searchSelections[msg]}"/>
      </h:column>

      <h:column>
      <f:facet name="header">
      <h:outputText value="#{msgs.rechercheQuestionnaireReference}" />
      </f:facet>
      <s:link value="#{msg.id}" action="#{search.selectionneQuestionnaire}" />
      </h:column>

      <h:column>
      <f:facet name="header">
      <h:outputText value="#{msgs.rechercheQuestionnaireDescription}" />
      </f:facet>
      <h:outputText value="#{msg.commentaire}" />
      </h:column>

      <h:column>
      <f:facet name="header">
      <h:outputText value="#{msgs.rechercheQuestionnaireNiveau}" />
      </f:facet>
      <h:outputText value="#{msg.endroit.description}" />
      </h:column>

      </h:dataTable>

      Whith one DataModel, when I click on the id link, the action was correctly executed, but I cannot figure out how to make it work with a second datamodel.

      What is the meaning of the "value" parameter in the DataModelSelection annotaion ? I went to seam documentation, but it was not very helpful

      Kind regards,
      Gerd