1 21 22 package org.opensubsystems.patterns.dialoglayout.www; 23 24 import javax.servlet.http.HttpServletRequest ; 25 import javax.servlet.jsp.JspException ; 26 27 import org.opensubsystems.core.www.BlockElementTag; 28 import org.opensubsystems.core.www.TagUtils; 29 30 40 public class DoubleSelectTag extends BlockElementTag 41 { 42 44 47 private static final long serialVersionUID = -4101558432379629892L; 48 49 53 protected String m_strvalue; 54 55 58 protected String m_strName; 59 60 62 65 public DoubleSelectTag() 66 { 67 super("clsStrechControl", BlockElementTag.DIV_BLOCK_ELEMENT); 68 m_strIdSuffix = "dscmpsite"; 69 m_strvalue = ""; 70 m_strName = null; 71 } 72 73 75 78 public int doStartTag() throws JspException 79 { 80 StringBuffer sbHtml = new StringBuffer (); 83 StringBuffer sbID = new StringBuffer (); 84 85 String strCurrentId = getCurrentId(); 88 89 sbID.append(strCurrentId); 91 sbID.append("_assigned_items"); 92 93 String strValue = ((HttpServletRequest )pageContext.getRequest() 95 ).getParameter(sbID.toString()); 96 97 if (strValue == null) 98 { 99 strValue = m_strvalue; 102 } 103 104 107 108 sbHtml.append("<input type=\"hidden\" id=\""); 109 sbHtml.append(sbID); 110 sbHtml.append("\""); 111 112 if ((m_strName != null) || (m_strName.length() > 0)) 113 { 114 sbHtml.append(" name=\""); 115 sbHtml.append(m_strName); 116 sbHtml.append("\""); 117 } 118 119 sbHtml.append(" value=\""); 120 if ((strValue != null) || (strValue.length() > 0)) 121 { 122 sbHtml.append(strValue); 123 } 124 sbHtml.append("\">\n"); 125 126 TagUtils.write(pageContext, sbHtml.toString()); 127 128 return super.doStartTag(); 129 } 130 131 134 public int doEndTag() throws JspException 135 { 136 return super.doEndTag(); 138 } 139 140 143 public String getName() 144 { 145 return m_strName; 146 } 147 148 152 public String getValue() 153 { 154 return m_strvalue; 155 } 156 157 160 public void setName( 161 String strName 162 ) 163 { 164 m_strName = strName; 165 } 166 167 171 public void setValue( 172 String strValue 173 ) 174 { 175 m_strvalue = strValue; 176 } 177 } 178 | Popular Tags |