[seam-commits] Seam SVN: r7841 - in branches/Seam_2_0/examples/ui: view and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Mon Apr 7 18:12:14 EDT 2008


Author: pete.muir at jboss.org
Date: 2008-04-07 18:12:14 -0400 (Mon, 07 Apr 2008)
New Revision: 7841

Modified:
   branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/AnimalList.java
   branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/Person.java
   branches/Seam_2_0/examples/ui/view/selectItems.xhtml
Log:
JBSEAM-2856

Modified: branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/AnimalList.java
===================================================================
--- branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/AnimalList.java	2008-04-07 22:00:52 UTC (rev 7840)
+++ branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/AnimalList.java	2008-04-07 22:12:14 UTC (rev 7841)
@@ -10,20 +10,20 @@
 public class AnimalList
 {
 
-   private List<String> animals;
+   private List<Animal> animals;
    
    @Unwrap
-   public List<String> unwrap()
+   public List<Animal> unwrap()
    {
       if (animals == null)
       {
-         animals = new ArrayList<String>();
-         animals.add("Dog");
-         animals.add("Cat");
-         animals.add("Goldfish");
-         animals.add("Rabbit");
-         animals.add("Snake");
-         animals.add("Parrot");
+         animals = new ArrayList<Animal>();
+         animals.add(Animal.CAT);
+         animals.add(Animal.DOG);
+         animals.add(Animal.GOLDFISH);
+         animals.add(Animal.PARROT);
+         animals.add(Animal.RABBIT);
+         animals.add(Animal.SNAKE);
       }
       return animals;
    }

Modified: branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/Person.java
===================================================================
--- branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/Person.java	2008-04-07 22:00:52 UTC (rev 7840)
+++ branches/Seam_2_0/examples/ui/src/org/jboss/seam/example/ui/Person.java	2008-04-07 22:12:14 UTC (rev 7841)
@@ -90,6 +90,8 @@
    
    private String pet;
    
+   
+   
    @ManyToOne
    private Film favouriteFilm;
    

Modified: branches/Seam_2_0/examples/ui/view/selectItems.xhtml
===================================================================
--- branches/Seam_2_0/examples/ui/view/selectItems.xhtml	2008-04-07 22:00:52 UTC (rev 7840)
+++ branches/Seam_2_0/examples/ui/view/selectItems.xhtml	2008-04-07 22:12:14 UTC (rev 7841)
@@ -74,7 +74,7 @@
 			<ui:define name="label">Pet</ui:define>
 			<ui:define name="description">The animal list is a list of Strings</ui:define>
 			<h:selectOneMenu value="#{person.pet}">
-				<s:selectItems value="#{animals}" var="animal" label="#{animal}" noSelectionLabel="Select your pet"/>
+				<s:selectItems value="#{animals}" var="animal" label="#{animal.name} (#{animal.notes})" itemValue="#{animal.notes}" noSelectionLabel="Select your pet"/>
 			</h:selectOneMenu>
 		</s:decorate>
 		




More information about the seam-commits mailing list