|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.click.control.AbstractControl net.sf.click.control.Field net.sf.click.control.TextArea
Provides a TextArea control: <textarea></textarea>.
Text Area |
TextArea commentsField = new TextArea("comments"); commentsField.setCols(40); commentsField.setRows(6); form.add(commentsField);The TextArea control will rendered HTML output:
<textarea name="comments" rows="6" cols="40"/></textarea>See also the W3C HTML reference: TEXTAREA
Field Summary | |
protected int |
cols
The number of text area columns. |
protected int |
maxLength
The maximum field length validation constraint. |
protected int |
minLength
The minimum field length validation constraint. |
protected int |
rows
The number of text area rows. |
protected static String |
VALIDATE_TEXTAREA_FUNCTION
The field validation JavaScript function template. |
Fields inherited from class net.sf.click.control.Field |
disabled, error, focus, form, help, label, readonly, required, tabindex, title, validate, value |
Fields inherited from class net.sf.click.control.AbstractControl |
actionListener, attributes, listener, listenerMethod, messages, name, parent, styles |
Fields inherited from interface net.sf.click.Control |
CONTROL_MESSAGES |
Constructor Summary | |
TextArea()
Create a TextArea with no name defined. |
|
TextArea(String name)
Construct the TextArea with the given name. |
|
TextArea(String name,
boolean required)
Construct the TextArea with the given name and required status. |
|
TextArea(String name,
int cols,
int rows)
Construct the TextArea with the given name, number of columns and number of rows. |
|
TextArea(String name,
String label)
Construct the TextArea with the given name and label. |
|
TextArea(String name,
String label,
boolean required)
Construct the TextArea with the given name, label and required status. |
|
TextArea(String name,
String label,
int cols,
int rows)
Construct the TextArea with the given name, label, number of columns and number of rows. |
|
TextArea(String name,
String label,
int cols,
int rows,
boolean required)
Construct the TextArea with the given name, label, number of columns and number of rows. |
Method Summary | |
int |
getCols()
Return the number of text area columns. |
int |
getControlSizeEst()
Return the estimated rendered control size in characters. |
int |
getMaxLength()
Returns the maximum field length validation constraint. |
int |
getMinLength()
Returns the minimum field length validation constraint. |
int |
getRows()
Return the number of text area rows. |
String |
getTag()
Return the textarea's html tag: textarea. |
String |
getValidationJavaScript()
Return the field JavaScript client side validation function. |
void |
render(HtmlStringBuffer buffer)
Render the HTML representation of the TextArea. |
void |
setCols(int cols)
Set the number of text area columns. |
void |
setMaxLength(int maxLength)
Sets the maximum field length. |
void |
setMinLength(int minLength)
Sets the minimum field length validation constraint. |
void |
setRows(int rows)
Set the number of text area rows. |
void |
validate()
Validate the TextArea request submission. |
Methods inherited from class net.sf.click.control.Field |
bindRequestValue, getError, getErrorLabel, getFocus, getFocusJavaScript, getForm, getHelp, getId, getLabel, getRequestValue, getTabIndex, getTextAlign, getTitle, getValidate, getValue, getValueObject, getWidth, isDisabled, isHidden, isReadonly, isRequired, isValid, onInit, onProcess, setDisabled, setError, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setFocus, setForm, setHelp, setLabel, setListener, setParent, setReadonly, setRequired, setTabIndex, setTextAlign, setTitle, setValidate, setValue, setValueObject, setWidth |
Methods inherited from class net.sf.click.control.AbstractControl |
addStyleClass, appendAttributes, getActionListener, getAttribute, getAttributes, getContext, getHtmlImports, getMessage, getMessage, getMessage, getMessages, getName, getPage, getParent, getStyle, getStyles, hasAttribute, hasAttributes, hasStyles, onDeploy, onDestroy, onRender, registerActionEvent, removeStyleClass, renderTagBegin, renderTagEnd, setActionListener, setAttribute, setId, setName, setStyle, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final String VALIDATE_TEXTAREA_FUNCTION
protected int cols
protected int maxLength
protected int minLength
protected int rows
Constructor Detail |
public TextArea(String name)
name
- the name of the fieldpublic TextArea(String name, String label)
name
- the name of the fieldlabel
- the label of the fieldpublic TextArea(String name, boolean required)
name
- the name of the fieldrequired
- the field required statuspublic TextArea(String name, String label, boolean required)
name
- the name of the fieldlabel
- the label of the fieldrequired
- the field required statuspublic TextArea(String name, int cols, int rows)
name
- the name of the fieldcols
- the number of text area colsrows
- the number of text area rowspublic TextArea(String name, String label, int cols, int rows)
name
- the name of the fieldlabel
- the label of the fieldcols
- the number of text area colsrows
- the number of text area rowspublic TextArea(String name, String label, int cols, int rows, boolean required)
name
- the name of the fieldlabel
- the label of the fieldcols
- the number of text area colsrows
- the number of text area rowsrequired
- the field required statuspublic TextArea()
Method Detail |
public String getTag()
getTag
in class AbstractControl
AbstractControl.getTag()
public int getCols()
public void setCols(int cols)
cols
- set the number of text area columns.public int getMaxLength()
maxLength
property is greater than zero, the Field values length
will be validated against this constraint when processed.
public void setMaxLength(int maxLength)
maxLength
property is
greater than zero, the Field values length will be validated against
this constraint when processed.
maxLength
- the maximum field length validation constraintpublic int getMinLength()
minLength
property is greater than zero, the Field values length
will be validated against this constraint when processed.
public void setMinLength(int minLength)
minLength
property is greater than zero, the Field values length
will be validated against this constraint when processed.
minLength
- the minimum field length validation constraintpublic int getRows()
public void setRows(int rows)
rows
- set the number of text area rowspublic int getControlSizeEst()
AbstractControl
getControlSizeEst
in class AbstractControl
AbstractControl.getControlSizeEst()
public void render(HtmlStringBuffer buffer)
render
in interface Control
render
in class AbstractControl
buffer
- the specified buffer to render the control's output toAbstractControl.toString()
public void validate()
Error message bundle key names include:net.sf.click.control.MessageProperties
- field-maxlength-error
- field-minlength-error
- field-required-error
validate
in class Field
public String getValidationJavaScript()
getValidationJavaScript
in class Field
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |