You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ca...@apache.org on 2007/01/24 21:25:25 UTC

svn commit: r499557 - in /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry: SelectOneCountry.java SelectOneCountryRenderer.java

Author: cagatay
Date: Wed Jan 24 12:25:24 2007
New Revision: 499557

URL: http://svn.apache.org/viewvc?view=rev&rev=499557
Log:
Fixed TOMAHAWK-869. EmptySelection's value is interpreted as empty string instead of null.

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountry.java
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRenderer.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountry.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountry.java?view=diff&rev=499557&r1=499556&r2=499557
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountry.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountry.java Wed Jan 24 12:25:24 2007
@@ -124,7 +124,7 @@
 
         List countriesSelectItems = new ArrayList( map.size() );
         if(getEmptySelection() != null)
-        	countriesSelectItems.add(new SelectItem(getEmptySelection(), getEmptySelection()));
+        	countriesSelectItems.add(new SelectItem("", getEmptySelection()));
 
         Integer maxLength = getMaxLength();
         int maxDescriptionLength = maxLength==null ? Integer.MAX_VALUE : maxLength.intValue();

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRenderer.java?view=diff&rev=499557&r1=499556&r2=499557
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRenderer.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/selectOneCountry/SelectOneCountryRenderer.java Wed Jan 24 12:25:24 2007
@@ -38,15 +38,6 @@
  * @version $Revision$ $Date$
  */
 public class SelectOneCountryRenderer extends HtmlMenuRenderer {
-
-	public void decode(FacesContext facesContext, UIComponent component) {
-		super.decode(facesContext, component);
-		SelectOneCountry selectOneCountry = (SelectOneCountry) component;
-		//if the empty selection is submitted, reset the submitted value
-		Object submittedValue = selectOneCountry.getSubmittedValue(); 
-		if(submittedValue != null && submittedValue.equals(selectOneCountry.getEmptySelection()))
-			selectOneCountry.setSubmittedValue(null);
-	}
 	
     public void encodeEnd(FacesContext facesContext, UIComponent component)
     throws IOException