1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.dbforms.taglib;
25
26 import javax.servlet.jsp.JspException;
27
28
29
30 /***
31 * <p>
32 * This tag renders a HTML TextArea - Element
33 * </p>
34 * this tag renders a dabase-datadriven textArea, which is an active element -
35 * the user can change data
36 *
37 * @author Joachim Peer
38 */
39 public class DbTextFieldTag extends AbstractDbBaseInputTag
40 implements javax.servlet.jsp.tagext.TryCatchFinally {
41 private java.lang.String password = "false";
42
43 /***
44 * Determines if the text field should be a password text field (display '')
45 *
46 * @param pwd DOCUMENT ME!
47 */
48 public void setPassword(String pwd) {
49 this.password = pwd;
50 }
51
52
53 /***
54 * DOCUMENT ME!
55 *
56 * @return DOCUMENT ME!
57 */
58 public String getPassword() {
59 return this.password;
60 }
61
62
63 /***
64 * DOCUMENT ME!
65 *
66 * @return DOCUMENT ME!
67 *
68 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
69 * @throws JspException DOCUMENT ME!
70 */
71 public int doEndTag() throws JspException {
72 try {
73
74 StringBuffer tagBuf = new StringBuffer("<input ");
75
76 if ("true".equals(this.getPassword())) {
77 tagBuf.append("type=\"password\" ");
78 } else {
79 tagBuf.append(prepareType());
80 }
81
82 tagBuf.append(prepareName());
83 tagBuf.append(prepareValue());
84 tagBuf.append(prepareSize());
85 tagBuf.append(prepareKeys());
86 tagBuf.append(prepareStyles());
87 tagBuf.append(prepareEventHandlers());
88 tagBuf.append("/>");
89
90 pageContext.getOut()
91 .write(tagBuf.toString());
92
93
94 writeOutSpecialValues();
95
96
97 getParentForm()
98 .addChildName(getName(), getFormFieldName());
99 } catch (java.io.IOException ioe) {
100 throw new JspException("IO Error: " + ioe.getMessage());
101 }
102
103 return EVAL_PAGE;
104 }
105
106
107 /***
108 * DOCUMENT ME!
109 */
110 public void doFinally() {
111 password = "false";
112 super.doFinally();
113 }
114
115
116 /***
117 * DOCUMENT ME!
118 *
119 * @return DOCUMENT ME!
120 *
121 * @throws javax.servlet.jsp.JspException DOCUMENT ME!
122 */
123 public int doStartTag() throws JspException {
124 super.doStartTag();
125
126 return SKIP_BODY;
127 }
128 }