1 7 package com.inversoft.verge.mvc.view.jsp.html; 8 9 10 import java.io.IOException ; 11 12 import javax.servlet.jsp.JspException ; 13 14 import com.inversoft.verge.mvc.view.HtmlViewToolkit; 15 16 17 22 public class CheckboxTag extends InputTag { 23 24 private Boolean checked; 25 26 27 32 public Boolean getChecked() { 33 return checked; 34 } 35 36 41 public void setChecked(Boolean checked) { 42 this.checked = checked; 43 } 44 45 50 public int doStartTag() throws JspException { 51 52 initialize(); 54 55 try { 56 StringBuffer buf = new StringBuffer (); 57 createCheckboxTag(buf, getId(), localName, localValue, checked); 58 pageContext.getOut().print(buf.toString()); 59 } catch (IOException ioe) { 60 throw new JspException (ioe.toString()); 61 } 62 63 return SKIP_BODY; 64 } 65 66 75 protected void createCheckboxTag(StringBuffer buf, String id, String name, 76 Object value, Boolean checked) 77 throws JspException { 78 boolean checkedBool = (checked == null) ? false : checked.booleanValue(); 79 String valueStr = (value == null) ? null : value.toString(); 80 HtmlViewToolkit.createCheckboxTag(buf, id, name, valueStr, checkedBool, 81 attributes, singleAttrs); 82 } 83 } | Popular Tags |