|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sas.Component | +--com.sas.servlet.beans.BaseTransformation | +--com.sas.servlet.beans.BaseInput | +--com.sas.servlet.beans.BaseText | +--com.sas.servlet.beans.html.Text
Transformation bean definition for creating an HTML text entry field. This is a single line text field.
Problem: Create a document using JSP that contains a text input field.
Solution: Write a Java scriptlet in a JSP page that uses the Text Transformation Bean to create the HTML element.
JSP Page:
<html> <body> <p> This example shows a simple text field generated by the Text Transformation Bean. </p> <FORM> <% // Create a new text object com.sas.servlet.beans.TextInterface text = new com.sas.servlet.beans.html.Text();
text.setName("stuff"); text.setSize(20); text.setMaximumLength(30); text.setText("foo bar"); text.write(out); %> </FORM> </body> </html>
HTML output:
<html> <body> <p> This example shows a simple text field generated by the Text Transformation Bean. </p> <FORM> <INPUT TYPE=text NAME="stuff" VALUE="foo bar" MAXLENGTH=30 SIZE=20> </FORM> </body> </html>
Live element:
Constructor Summary | |
Text()
Constructs a new Text Transformation Bean |
|
Text(String name)
Constructs a new Text Transformation Bean |
|
Text(String name,
String value)
Constructs a new Text Transformation Bean |
|
Text(String name,
String value,
int size)
Constructs a new Text Transformation Bean |
|
Text(String name,
String value,
int size,
int len)
Constructs a new Text Transformation Bean |
Method Summary | |
void |
write(PrintWriter out)
Writes the transformed representation of the object |
Methods inherited from class com.sas.servlet.beans.BaseInput |
getMaximumLength,
getSize,
getText,
setMaximumLength,
setSize,
setText |
Methods inherited from class com.sas.servlet.beans.BaseTransformation |
getCustomAttributes,
getDescription,
getName,
getParent,
getRequest,
getResponse,
setCustomAttributes,
setDescription,
setName,
setParent,
setRequest,
setResponse,
toString,
write,
write,
write |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Text()
public Text(String name)
name
- The text field namepublic Text(String name, String value)
name
- The text field namevalue
- The initial text valuepublic Text(String name, String value, int size)
name
- The text field namevalue
- The initial text valuesize
- The visible size of the text fieldpublic Text(String name, String value, int size, int len)
name
- The text field namevalue
- The initial text valuesize
- The visible size of the text fieldlen
- The maximum input lengthMethod Detail |
public void write(PrintWriter out) throws IOException
out
- The output stream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |