Anonymous avatar Anonymous committed 98de5cc

Fixes to doubleselecttag. Fixed WW-585.

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

Comments (0)

Files changed (6)

src/java/com/opensymphony/webwork/views/jsp/ui/AbstractDoubleListTag.java

 
 
 /**
- * @author <a href="mailto:m.bogaert@intrasoft.be">Mathias Bogaert</a>
+ * @author <a href="mailto:m.bogaert@memenco.com">Mathias Bogaert</a>
  */
 public abstract class AbstractDoubleListTag extends AbstractListTag {
     //~ Instance fields ////////////////////////////////////////////////////////

src/java/com/opensymphony/webwork/views/jsp/ui/ComboBoxTag.java

 
 import com.opensymphony.xwork.util.OgnlValueStack;
 
-
 /**
- * User: plightbo
- * Date: Nov 3, 2003
- * Time: 9:31:30 PM
+ * @author $Author$
+ * @version $Revision$
  */
-public class ComboBoxTag extends AbstractUITag {
+public class ComboBoxTag extends TextFieldTag {
     //~ Static fields/initializers /////////////////////////////////////////////
 
     /**
     //~ Instance fields ////////////////////////////////////////////////////////
 
     protected String list;
-    protected String maxlengthAttr;
-    protected String sizeAttr;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    public void setList(String aList) {
-        this.list = aList;
-    }
-
-    public void setMaxlength(String aMaxlength) {
-        this.maxlengthAttr = aMaxlength;
-    }
-
-    public void setSize(String aSize) {
-        this.sizeAttr = aSize;
+    public void setList(String list) {
+        this.list = list;
     }
 
     protected String getDefaultTemplate() {
         return TEMPLATE;
     }
 
-    protected Class getValueClassType() {
-        return Boolean.class; // for checkboxes, everything needs to end up as a Boolean
-    }
-
-    protected void evaluateExtraParams(OgnlValueStack stack) {
+    public void evaluateExtraParams(OgnlValueStack stack) {
         if (list != null) {
             addParameter("list", findValue(list));
         }
-
-        if (sizeAttr != null) {
-            addParameter("size", findValue(sizeAttr, Integer.class));
-        }
-
-        if (maxlengthAttr != null) {
-            addParameter("maxlength", findValue(maxlengthAttr, Integer.class));
-        }
     }
 }

src/java/com/opensymphony/webwork/views/jsp/ui/DoubleSelectTag.java

 
 
 /**
- * @author <a href="mailto:m.bogaert@intrasoft.be">Mathias Bogaert</a>
+ * @author <a href="mailto:m.bogaert@memenco.com">Mathias Bogaert</a>
  * @version $Id$
  */
 public class DoubleSelectTag extends AbstractDoubleListTag {

src/java/com/opensymphony/webwork/views/jsp/ui/TextFieldTag.java

 
 import com.opensymphony.xwork.util.OgnlValueStack;
 
-
 /**
  * @author $Author$
  * @version $Revision$

src/java/template/simple/combobox.vm

 <input type="text"
-       name="$!webwork.htmlEncode($parameters.name)"
+                                   name="$!webwork.htmlEncode($parameters.name)"
 #if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"            #end
 #if ($parameters.maxlength)        maxlength="$!webwork.htmlEncode($parameters.maxlength)"  #end
 #if ($parameters.nameValue)        value="$!webwork.htmlEncode($parameters.nameValue)"      #end
 #if ($parameters.disabled == true) disabled="disabled"                                      #end
+#if ($parameters.readonly)         readonly="readonly"                                      #end
 #if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)"    #end
 #if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"                #end
 #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"       #end
 /><br/>
 
 #if ($parameters.list)
-      <select onChange="this.form.elements['$!webwork.htmlEncode($parameters.name)'].value=this.options[this.selectedIndex].value"
-         #if ($parameters.disabled == true) disabled="disabled" #end
-      >
-            #foreach ($param in $parameters.list)
-                <option value="$!webwork.htmlEncode($param)" #if ($parameters.name == $param) selected="selected" #end >$!webwork.htmlEncode($param)</option>
-            #end
-      </select>#end
+<select onChange="this.form.elements['$!webwork.htmlEncode($parameters.name)'].value=this.options[this.selectedIndex].value"
+     #if ($parameters.disabled == true) disabled="disabled" #end
+>
+#foreach ($param in $parameters.list)
+    <option value="$!webwork.htmlEncode($param)"#if ($parameters.name == $param) selected="selected"#end>$!webwork.htmlEncode($param)</option>
+#end
+</select>#end

src/java/template/simple/doubleselect.vm

 #parse("/template/xhtml/controlheader.vm")
 
-<select name="$!parameters.name"
-    #if ($parameters.size)             size="$parameters.size"                              #end
-    #if ($parameters.disabled)         disabled="disabled"                                  #end
-    #if ($parameters.tabindex)         tabindex="$parameters.tabindex"                      #end
-    #if ($parameters.id)               id="$parameters.id"                                  #end
-    #if ($parameters.multiple)         multiple="multiple"                                  #end
-    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"   #end
-    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"   #end
+<select name="$!webwork.htmlEncode($parameters.name)"
+    #if ($parameters.size)             size="$!webwork.htmlEncode($parameters.size)"         #end
+    #if ($parameters.disabled)         disabled="disabled"                                   #end
+    #if ($parameters.tabindex)         tabindex="$!webwork.htmlEncode($parameters.tabindex)" #end
+    #if ($parameters.id)               id="$!webwork.htmlEncode($parameters.id)"             #end
+    #if ($parameters.multiple)         multiple="multiple"                                   #end
+    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"    #end
+    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"    #end
     onchange="$!{parameters.name}Redirect(this.options.selectedIndex)"
 >
 
 
 <br/>
 
-<select name="$!parameters.doubleName"
-    #if ($parameters.doubleTabindex)   tabindex="$parameters.doubleTabindex"                #end
-    #if ($parameters.doubleId)         id="$parameters.doubleId"                            #end
-    #if ($parameters.multiple)         multiple="multiple"                                  #end
-    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"   #end
-    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"   #end
+<select name="$!webwork.htmlEncode($parameters.doubleName)"
+    #if ($parameters.doubleTabindex)   tabindex="$!webwork.htmlEncode($parameters.doubleTabindex)" #end
+    #if ($parameters.doubleId)         id="$!webwork.htmlEncode($parameters.doubleId)"             #end
+    #if ($parameters.multiple)         multiple="multiple"                                         #end
+    #if ($parameters.cssClass)         class="$!webwork.htmlEncode($parameters.cssClass)"          #end
+    #if ($parameters.cssStyle)         style="$!webwork.htmlEncode($parameters.cssStyle)"          #end
 >
 </select>
 
 //-->
 </script>
 
-
 #parse("/template/xhtml/controlfooter.vm")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.