[richfaces-svn-commits] JBoss Rich Faces SVN: r5840 - trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Feb 5 13:34:37 EST 2008


Author: abelevich
Date: 2008-02-05 13:34:36 -0500 (Tue, 05 Feb 2008)
New Revision: 5840

Modified:
   trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
Log:


Modified: trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java	2008-02-05 18:33:50 UTC (rev 5839)
+++ trunk/sandbox/samples/pickList-sample/src/main/java/org/richfaces/Bean.java	2008-02-05 18:34:36 UTC (rev 5840)
@@ -1,75 +1,42 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
- */
-
 package org.richfaces;
 
 import java.util.ArrayList;
-
 import javax.faces.event.ValueChangeEvent;
 import javax.faces.model.SelectItem;
 
-public class Bean
-{
-    private ArrayList testList = new ArrayList();
+public class Bean {
 
+private ArrayList testList = new ArrayList();
     private String selectedInfo;
 
-    public Bean()
-    {
-        testList.add(new SelectItem("polecat", "Value-polecat"));
-        testList.add(new SelectItem("suricate", "Value-suricate"));
-        testList.add(new SelectItem("marshotter", "Value-marshotter"));
+    public Bean() {
+        testList.add(new SelectItem("polecat", "polecat"));
+        testList.add(new SelectItem("suricate", "suricate"));
+        testList.add(new SelectItem("marshotter", "marshotter"));
     }
 
-    public void selectionChanged(ValueChangeEvent evt)
-    {
-        String[] selectedValues = (String[]) evt.getNewValue();
-
-        if (selectedValues.length == 0)
-        {
+    public void selectionChanged(ValueChangeEvent evt) {
+        
+    	String[] selectedValues = (String[]) evt.getNewValue();
+        if (selectedValues.length == 0) {
             selectedInfo = "No selected values";
-        }
-        else
-        {
-
+        } else {
             StringBuffer sb = new StringBuffer("Selected values: ");
-
-            for (int i = 0; i < selectedValues.length; i++)
-            {
-                if (i > 0)
+            for (int i = 0; i < selectedValues.length; i++) {
+                if (i > 0) { 
                     sb.append(", ");
+                }    
                 sb.append(selectedValues[i]);
             }
-
             selectedInfo = sb.toString();
         }
     }
 
-    public ArrayList getTestList()
-    {
+    public ArrayList getTestList() {
         return testList;
     }
 
-    public String getSelectedInfo()
-    {
+    public String getSelectedInfo() {
         return selectedInfo;
     }
 




More information about the richfaces-svn-commits mailing list