2 Replies Latest reply on Jun 19, 2008 11:58 PM by Alexandre Costa

    Help needed with selectOneMenu

    Alexandre Costa Newbie

      Hi,


      first let me say that i'm a total beginner with Seam and JSF.


      Anyway, i'm having a problem in a project that i'm involved with.
      I have this code on the page:


      <h:outputLabel for="cb_add">Inserir:</h:outputLabel>
      <h:selectOneMenu id="cb_add">
           <s:selectItems var="addDefName" value="#{gestDocuments.addDefNames}" label="#{addDefName}" />
      </h:selectOneMenu>
      <h:commandButton id="bt_add" action="#{gestDocuments.add}" value="Inserir" />



      On my component (It's a simple Java Bean) i have:


      @Name("gestDocuments")
      @Scope(ScopeType.SESSION)
      public class GestaoDocumentsWS{
      ...
      @DataModel
      private List<String> addDefNames;
      @DataModelSelection(value = "addDefNames")
      private String addDefName;
      



      The problem is that whenever i click the button, i want to get the String that was selected on the combobox and now  it's always giving me the first item on the List.


      What am i doing wrong?


      Thank you


      Alex