|
||||||||||
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.BaseTextArea | +--com.sas.servlet.beans.html.TextArea
Transformation bean for creating an HTML TextArea input field.
Problem: Create a document using JSP that contains a text area input field.
Solution: Write a Java scriptlet in a JSP page that uses the TextArea Transformation Bean to create the HTML element.
JSP Page:
<html> <body> <p> This example shows a simple text area field generated by the TextArea Transformation Bean. </p> <FORM> <% // Create a new TextArea object com.sas.servlet.beans.TextAreaInterface ta = new com.sas.servlet.beans.html.TextArea();
// Set some initial values ta.setName("comments"); ta.setRows(5); ta.setColumns(30); ta.setText("These are my comments...");
// Output the TextArea ta.write(out); %> </FORM> </body> </html>
HTML output:
<html> <body> <p> This example shows a simple text field generated by the Text Transformation Bean. </p> <TEXTAREA NAME="comments" COLS=30 ROWS=5> These are my comments... </TEXTAREA> </body> </html>
Live element:
Constructor Summary | |
TextArea()
Construct a new TextArea Transformation Bean |
|
TextArea(String name)
Construct a new TextArea Transformation Bean |
|
TextArea(String name,
String text)
Construct a new TextArea Transformation Bean |
|
TextArea(String name,
String text,
int rows)
Construct a new TextArea Transformation Bean |
|
TextArea(String name,
String text,
int rows,
int columns)
Construct a new TextArea Transformation Bean |
Method Summary | |
void |
write(PrintWriter out)
Writes the transformed representation of the object |
Methods inherited from class com.sas.servlet.beans.BaseTextArea |
appendText,
getColumns,
getRows,
getText,
getWrap,
setColumns,
setRows,
setText,
setWrap |
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 TextArea()
public TextArea(String name)
name
- The name of the TextAreapublic TextArea(String name, String text)
name
- The name of the TextAreatext
- The initial textpublic TextArea(String name, String text, int rows)
name
- The name of the TextAreatext
- The initial textrows
- The number of visible rowspublic TextArea(String name, String text, int rows, int columns)
name
- The name of the TextAreatext
- The initial textrows
- The number of visible rowscolumns
- The number of columnsMethod 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 |