|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.shr.page.AgpTag | +--com.sssw.shr.page.AgpControlBase | +--com.sssw.shr.page.AgpTextArea
TextArea HTML form control. This control lets the user enter multiple lines of text.
Fields inherited from class com.sssw.shr.page.AgpTag |
UNIT_PERCENT,
UNIT_PIXEL |
Constructor Summary | |
AgpTextArea()
|
Method Summary | |
int |
getColumnCount()
Returns the width of the control as a number of characters. |
boolean |
getEmptyStringIsNull()
Returns whether the value of an empty text control is null . |
int |
getRowCount()
Returns the height of this control, expressed as a number of rows of text. |
boolean |
getSubmitOnChange()
Returns the "Submit On Change" property of this control. |
String |
getText()
Returns the text of the control. |
String |
getValue()
Returns the value of the control, as a string. |
void |
setColumnCount(int columncount)
Sets the width of this control, expressed as a number of character widths. |
void |
setEmptyStringIsNull(boolean b)
Specifies whether the value of an empty text control is null . |
void |
setRowCount(int rowcount)
Sets the height of this control, expressed as a number of rows of text. |
void |
setSubmitOnChange(boolean submit_on_change)
Sets the Submit On Change property of this control. |
void |
setText(String text)
Sets the text of the control. |
void |
setValue(String value)
Sets the value of the control. |
Methods inherited from class com.sssw.shr.page.AgpControlBase |
getName |
Methods inherited from class com.sssw.shr.page.AgpTag |
getBoolProperty,
getEnableHTMLGeneration,
getIntArrayProperty,
getIntProperty,
getIntPropertyUnit,
getProperty,
getStringArrayProperty,
invalidateHTML,
removeProperty,
setEnableHTMLGeneration,
setIntProperty,
setProperty |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Methods implemented from interface com.sssw.shr.page.AgiJavaScriptEnhanced |
generateFunction,
generateRepaintScript,
generateScriptInitializers,
getFunctionNameForMethod,
getFunctionNames,
getMethodNames,
getScriptObjectName,
isHTMLRepaintPending,
isJavaScriptRepaintPending |
Methods implemented from interface com.sssw.shr.page.AgiPageControl |
generateHTML,
getPrefix,
notifyPageLoaded,
notifyPageRequestBegin,
notifyPageRequestEnd,
notifyPostValue,
notifyPostValues |
Methods implemented from interface java.io.Externalizable |
readExternal,
writeExternal |
Constructor Detail |
public AgpTextArea()
Method Detail |
public int getRowCount()
setRowCount
method.The height of the control shown in the Page Designer is an approximation. The control as displayed to the user in the browser may vary slightly from its design-time appearance.
// if this text area is not already at least ten rows high, make it so if (TextArea1.getRowCount() < 10) TextArea1.setRowCount(10);
AgpTextArea.setRowCount(int rowcount)
public void setRowCount(int rowcount)
rowCount
- the number of rows in the control's height.The height of the control shown in the Page Designer is an approximation. The control as displayed to the user in the browser may vary slightly from its design-time appearance.
// if this text area is not already at least ten rows high, make it so if (TextArea1.getRowCount() < 10) TextArea1.setRowCount(10);
AgpTextArea.getRowCount()
public int getColumnCount()
setColumnCount()
method.The width of the control shown in the Page Designer is an approximation. The control as displayed to the user in the browser may vary slightly from its design-time appearance.
AgpTextArea.setColumnCount(int columncount)
public void setColumnCount(int columncount)
columncount
- the number of characters in the
control's width.The width of the control shown in the Page Designer is an approximation. The control as displayed to the user in the browser may vary slightly from its design-time appearance.
// if there isn't enough room for a particular string // try to make this text field bigger int len = headerString.length(); if (Field1.getSize() < len) { Field1.setSize(len); }
AgpTextArea.getColumnCount()
public String getText()
null
. If the
control's value is null
, getText()
returns the empty string.
Because this is a multi-line edit control, the returned text may contain newline characters.// Put brackets at the beginning and end of the text in the control // if there is any text in it, and it hasn't already been bracketed String oldText = TextArea1.getText().trim(); if ((oldText.length() > 0) && !(oldText.startsWith("[") && oldText.endsWith("]"))) { TextArea1.setText("["+oldText+"]"); }
AgpTextArea.setEmptyStringIsNull(boolean b)
,
AgpTextArea.setText(String text)
public void setText(String text)
text
- the new string.// Put brackets at the beginning and end of the text in the control // if there is any text in it, and it hasn't already been bracketed String oldText = TextArea1.getText().trim(); if ((oldText.length() > 0) && !(oldText.startsWith("[") && oldText.endsWith("]"))) { TextArea1.setText("["+oldText+"]"); }
AgpTextArea.getText()
public String getValue()
null
.
If the control is bound to a database field, this is the value that will be stored.// if this field has a null value, display a warning label if (TextArea1.getValue() == null) { lblWarning.setText("You must enter an explanation in the text area."); lblWarning.setEnableHTMLGeneration(true); } else { // hide the label lblWarning.setEnableHTMLGeneration(false); }
AgpTextArea.setValue(String value)
public void setValue(String value)
value
- a string that should appear in the
text area, or null
.// if the text area has a value, reset it to a default, but leave it alone if it's null if (TextArea1.getValue() != null) { TextArea1.setValue("Please enter a new description here."); }
AgpTextArea.getValue()
public boolean getSubmitOnChange()
setSubmitOnChange
method.
If this property is true
, then the control will send a Submit request to
the server when the end user has entered text.// Display or hide a "Submit" button on the page, depending on whether the control // named TextArea1 is going to handle its own submits if (TextArea1.getSubmitOnChange()) { // Field1 will submit, don't show the button btnSubmit.setEnableHTMLGeneration(false); } else { // Field1 will not submit, so we need the button TextArea1.setEnableHTMLGeneration(true); }
AgpTextArea.setSubmitOnChange(boolean submit_on_change)
public void setSubmitOnChange(boolean submit_on_change)
submit_on_change
- true
to
send a Submit request to the server when the value
changes, otherwise false
.This functionality depends on JavaScript. It will not work in all browsers.
// depending on an application flag, set this text field to automatically // submit a request to the server when the user enters text. if (g_JavaScriptOK) { Field1.setSubmitOnChange(true); }
AgpTextArea.getSubmitOnChange()
public boolean getEmptyStringIsNull()
null
.
A text field containing no characters can be interpreted in two ways: either its
value is null
or it is the empty string, ""
. The null
value is generally more appropriate when the field is bound to a database column that can
contain a null value, so as to avoid storing a value of ""
in the database.
Some applications will require that the text field contain a valid String object at all times,
so they will use the empty string value for an empty field.
The default value of this property is false
.
If true
, then the value of an empty text control is
null
instead of the empty string. This property can be set programmatically
using the setEmptyStringIsNull
method.
boolean emptyIsNull = Field1.getEmptyStringIsNull();
AgpTextArea.getText()
,
AgpTextArea.setEmptyStringIsNull(boolean b)
public void setEmptyStringIsNull(boolean b)
null
.
The default setting is false
.
A text area containing no characters can be interpreted in two ways: either its
value is null
or it is the empty string, ""
. The null
value is generally more appropriate when the text area is bound to a database column that can
contain a null value, so as to avoid storing a value of ""
in the database.
Some applications will require that the text area contain a valid String object at all times,
so they will use the empty string value for an empty text area.
b
- true
if the value of an empty text control should be
null
instead of the empty string; otherwise false
.
Note that getText()
on an empty text area will always return the empty string.
// Indicate that this text area should return a null value if // the user deletes its contents TextArea1.setEmptyStringIsNull(true);
AgpTextArea.getEmptyStringIsNull()
,
AgpTextArea.getText()
|
SilverStream Application Server 3.5 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |