1 package com.opensymphony.webwork.components; 2 3 import com.opensymphony.xwork.util.OgnlValueStack; 4 5 import javax.servlet.http.HttpServletRequest ; 6 import javax.servlet.http.HttpServletResponse ; 7 8 13 public class DoubleSelect extends DoubleListUIBean { 14 final public static String TEMPLATE = "doubleselect"; 15 16 protected String emptyOption; 17 protected String headerKey; 18 protected String headerValue; 19 protected String multiple; 20 protected String size; 21 22 public DoubleSelect(OgnlValueStack stack, HttpServletRequest request, HttpServletResponse response) { 23 super(stack, request, response); 24 } 25 26 protected String getDefaultTemplate() { 27 return TEMPLATE; 28 } 29 30 public void evaluateExtraParams() { 31 super.evaluateExtraParams(); 32 33 if (emptyOption != null) { 34 addParameter("emptyOption", findValue(emptyOption, Boolean .class)); 35 } 36 37 if (multiple != null) { 38 addParameter("multiple", findValue(multiple, Boolean .class)); 39 } 40 41 if (size != null) { 42 addParameter("size", findString(size)); 43 } 44 45 if ((headerKey != null) && (headerValue != null)) { 46 addParameter("headerKey", findString(headerKey)); 47 addParameter("headerValue", findString(headerValue)); 48 } 49 50 addParameter("onchange", getParameters().get("name") + "Redirect(this.options.selectedIndex)"); 52 } 53 54 public void setEmptyOption(String emptyOption) { 55 this.emptyOption = emptyOption; 56 } 57 58 public void setHeaderKey(String headerKey) { 59 this.headerKey = headerKey; 60 } 61 62 public void setHeaderValue(String headerValue) { 63 this.headerValue = headerValue; 64 } 65 66 public void setMultiple(String multiple) { 67 this.multiple = multiple; 68 } 69 70 public void setSize(String size) { 71 this.size = size; 72 } 73 } 74 | Popular Tags |