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 org.apache.log4j.Logger; 15 16 import com.inversoft.util.ObjectTools; 17 import com.inversoft.verge.mvc.view.HtmlViewToolkit; 18 19 20 25 public class RadioTag extends InputTag { 26 27 30 private static final Logger logger = Logger.getLogger(RadioTag.class); 31 32 private Boolean checked; 33 34 35 40 public Boolean getChecked() { 41 return checked; 42 } 43 44 49 public void setChecked(Boolean checked) { 50 this.checked = checked; 51 } 52 53 56 public int doStartTag() throws JspException { 57 58 initialize(); 60 61 StringBuffer buf = new StringBuffer (); 62 createRadioTag(buf, getId(), localName, localValue, checked); 63 if (logger.isDebugEnabled()) { 64 logger.debug("The radio tag: " + buf.toString()); 65 } 66 67 try { 68 pageContext.getOut().print(buf.toString()); 69 } catch (IOException ioe) { 70 throw new JspException (ioe.toString()); 71 } 72 73 return SKIP_BODY; 74 } 75 76 84 protected void createRadioTag(StringBuffer buf, String id, String name, 85 Object value, Boolean checked) 86 throws JspException { 87 boolean checkedBool = (checked == null) ? false : checked.booleanValue(); 88 String valueStr = ObjectTools.toString(getValue()); 89 HtmlViewToolkit.createRadioTag(buf, id, name, valueStr, checkedBool, 90 attributes, singleAttrs); 91 } 92 } 93 | Popular Tags |