2 Replies Latest reply on Aug 21, 2007 11:56 AM by Matt Drees

    Learning to use s:selectItems

    Michael Price Newbie

      Using jboss-4.2.1.GA and jboss-seam-2.0.0.BETA1

      Given in peoplePopup.xhtml

      <s:selectItems value="#{allPeople}" var="n" label="#{n.name}" />

      in PersonManagerAction.java
      private List allPeople;

      private Person selectedPerson;

      allPeople has an @Factory method and the list pops up fine showing the names from all the Person entities and lets me make the selection

      then the following is executed from a commandButton in peoplePopup.xhtml
      public void selectTest()
      System.out.println("******* selectTest Name= "+selectedPerson.getName());

      always prints out the first item in the selection list regardless of which one I selected.

      So I am thinking this is not the way to do this. I think it would be cool though.

      In other words select a name in the popup list and have the selected value be the associated Person entity object.