struts-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r771753 - /struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java
Date Tue, 05 May 2009 14:43:54 GMT
Author: wesw
Date: Tue May  5 14:43:54 2009
New Revision: 771753

URL: http://svn.apache.org/viewvc?rev=771753&view=rev
Log:
WW-3103, patch from Jordi Albert, fixing emptyOption param, thanks!

Modified:
    struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java

Modified: struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java
URL: http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java?rev=771753&r1=771752&r2=771753&view=diff
==============================================================================
--- struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java
(original)
+++ struts/struts2/trunk/plugins/javatemplates/src/main/java/org/apache/struts2/views/java/simple/SelectHandler.java
Tue May  5 14:43:54 2009
@@ -63,6 +63,13 @@
             boolean selected = ContainUtil.contains(value, params.get("headerKey"));
             writeOption(headerKey, headerValue, selected);
         }
+	
+	//emptyoption
+        Object emptyOption = params.get("emptyOption");
+        if (emptyOption != null && emptyOption.toString().equals(Boolean.toString(true)))
{
+        	boolean selected = ContainUtil.contains(value, "") || ContainUtil.contains(value,
null);
+        	writeOption("", "", selected);
+        }
 
         Object listObj = params.get("list");
         String listKey = (String) params.get("listKey");



Mime
View raw message