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 Select extends ListUIBean { 14 final public static String TEMPLATE = "select"; 15 16 protected String emptyOption; 17 protected String headerKey; 18 protected String headerValue; 19 protected String multiple; 20 protected String size; 21 22 public Select(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 51 public void setEmptyOption(String emptyOption) { 52 this.emptyOption = emptyOption; 53 } 54 55 public void setHeaderKey(String headerKey) { 56 this.headerKey = headerKey; 57 } 58 59 public void setHeaderValue(String headerValue) { 60 this.headerValue = headerValue; 61 } 62 63 public void setMultiple(String multiple) { 64 this.multiple = multiple; 65 } 66 67 public void setSize(String size) { 68 this.size = size; 69 } 70 } 71 | Popular Tags |