1. opensymphony
  2. webwork

Commits

plightbo  committed 003dea3

put empty option back in

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@56573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 70f37db
  • Branches master

Comments (0)

Files changed (2)

File src/java/com/opensymphony/webwork/views/jsp/ui/SelectTag.java

View file
  • Ignore whitespace
 
     //~ Instance fields ////////////////////////////////////////////////////////
 
+    private boolean emptyOption;
     private boolean multiple;
     private int size;
     private String defaultKey = "";
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public void setEmptyOption(boolean emptyOption) {
+        this.emptyOption = emptyOption;
+    }
+
+    public boolean isEmptyOption() {
+        return emptyOption;
+    }
+
     public void setMultiple(boolean multiple) {
         this.multiple = multiple;
     }
      */
     public void release() {
         super.release();
+        this.emptyOption = false;
         this.multiple = false;
         this.size = 0;
         this.defaultKey = "";

File src/java/templates/xhtml/select.vm

View file
  • Ignore whitespace
   #end
   <option value="$!{tag.defaultValue}"#if( $tag.contains($tag.ActualValue, $itemValue) ) selected="selected"#end>$!{defaultKeyValue}</option>
 #end
+#if( $tag.EmptyOption)<option></option>#end
 #set( $items = ${stack.findValue($tag.list)} )
 #if( $items )
 #foreach( $item in $items )