1 23 24 package org.dbforms.taglib; 25 26 import javax.servlet.jsp.*; 27 28 29 30 73 public class DbAssociatedRadioTag extends DbBaseHandlerTag 74 implements javax.servlet.jsp.tagext.TryCatchFinally { 75 private String name; 76 77 82 public void setName(String name) { 83 this.name = name; 84 } 85 86 87 92 public String getName() { 93 return name; 94 } 95 96 97 100 public void doCatch(Throwable t) throws Throwable { 101 throw t; 102 } 103 104 105 113 public int doEndTag() throws javax.servlet.jsp.JspException { 114 try { 115 StringBuffer tagBuf = new StringBuffer ("<input type=\"radio\" name=\""); 116 tagBuf.append(name); 117 tagBuf.append("\" value=\""); 118 tagBuf.append(getParentForm().getTable().getId()); 119 tagBuf.append("_"); 120 tagBuf.append(getParentForm().getPositionPath()); 121 122 tagBuf.append("\""); 124 125 if (getParentForm() 126 .getCurrentCount() == 0) { 127 tagBuf.append(" checked=\"true\""); 128 } 129 130 tagBuf.append("/>"); 131 pageContext.getOut() 132 .write(tagBuf.toString()); 133 } catch (java.io.IOException ioe) { 134 throw new JspException("IO Error: " + ioe.getMessage()); 135 } 136 137 return EVAL_PAGE; 138 } 139 140 141 144 public void doFinally() { 145 name = null; 146 super.doFinally(); 147 } 148 } 149 | Popular Tags |