Commits

mbogaert  committed 3f10ef1

Added name and value.

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

  • Participants
  • Parent commits fcfa958

Comments (0)

Files changed (1)

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

 public abstract class AbstractDoubleListTag extends AbstractListTag {
     //~ Instance fields ////////////////////////////////////////////////////////
 
+    protected String doubleNameAttr;
     protected String doubleListAttr;
     protected String doubleListKeyAttr;
     protected String doubleListValueAttr;
+    protected String doubleValueAttr;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
+    public void setDoubleName(String aName) {
+        doubleNameAttr = aName;
+    }
     
     public void setDoubleList(String list) {
         this.doubleListAttr = list;
         this.doubleListValueAttr = listValue;
     }
     
+    public void setDoubleValue(String doubleValue) {
+        this.doubleValueAttr = doubleValue;
+    }
+    
     public void evaluateExtraParams(OgnlValueStack stack) {
         super.evaluateExtraParams(stack);
         
+        Object doubleName = null;
+        
+        if (doubleNameAttr != null) {
+            doubleName = findValue(doubleNameAttr, String.class);
+            addParam("doubleName", doubleName);
+        }
+        
         if (doubleListAttr != null) {
             Object value = findValue(doubleListAttr);
             addParam("doubleList", MakeIterator.convert(value));
         if (doubleListValueAttr != null) {
             addParam("doubleListValue", doubleListValueAttr);
         }
+        
+        Class valueClazz = getValueClassType();
+
+        if (valueClazz != null) {
+            if (doubleValueAttr != null) {
+                addParam("doubleNameValue", findValue(doubleValueAttr, valueClazz));
+            } else if (doubleName != null) {
+                addParam("doubleNameValue", findValue(doubleName.toString(), valueClazz));
+            }
+        } else {
+            if (doubleValueAttr != null) {
+                addParam("doubleNameValue", findValue(doubleValueAttr));
+            } else if (doubleName != null) {
+                addParam("doubleNameValue", findValue(doubleName.toString()));
+            }
+        }
     }
 }