DhText | +--DhEditpublic class DhEdit
Represents all edit box functions in an HTML document. Edit boxes can be multiline, single line, or single line password styles. Password edit boxes behave like single line edit boxes, except their contents are masked by the asterisk (*) character.
Constructors
Name | Description |
---|---|
DhEdit() | Creates an edit box. |
DhEdit( String strText ) | Creates an edit box. |
DhEdit( String strText, boolean multiline ) | Creates an edit box. |
Methods
Name | Description |
---|---|
addOnChange ( DhEventHandler h ) | Sets the handler for the onchange event. |
addOnSelect ( DhEventHandler h ) | Sets the handler for the onselect event. |
getCols() | Retrieves the width, in characters, of the edit box. |
getEnabled() | Retrieves the enabled state of the edit box. |
getMaxLength() | Retrieves the current maximum input length for the edit. |
getMultiline() | Indicates if the edit control allows editing on more than one line or not. |
getPassword() | Indicates whether the edit control is being used for password input and must conceal its value. |
getReadOnly() | Retrieves the current read-only mode. |
getRows() | Retrieves the current number of rows for a multiline edit box. |
getSubmitName( ) | Retrieves the name of the edit box, which is used for HTTP form submissions. |
getText( ) | Retrieves the current text for the edit. |
getWordWrap() | Retrieves the current wrapping mode. |
removeOnChange ( DhEventHandler h ) | Removes the handler for the onchange event. |
removeOnSelect ( DhEventHandler h ) | Removes the handler for the onselect event. |
setCols(int cols) | Sets the number of columns (characters) for the edit box width. |
setEnabled( boolean f) | Sets the enabled state of the edit box. |
setFocus() | Sets the input focus to this edit box |
setMaxLength( int nMaxLength ) | Sets the current maximum input length of the edit control in characters. |
setMultiline(boolean multiline) | Indicates if the edit control allows editing on more than one line or not. |
setPassword(boolean value) | Specifies whether the edit control is being used for password input and must conceal its value. |
setReadOnly( boolean fReadOnly ) | Sets the read-only mode for the edit control. |
setRows(int rows) | Sets the number of rows in a multiline edit box. |
setSubmitName( String strName ) | Sets the name of the edit box. |
setText( String strText ) | Sets the current text display of the edit box. |
setWordWrap(boolean wrap) | Sets the wrapping mode for a multiline edit box. |
Creates an edit box. This constructor creates a blank, single line DhEdit edit box.
Creates an edit box. This constructor creates a single line DhEdit edit box.
Creates an edit box. This constructor creates a DhEdit edit box.
Sets the handler for the onchange event. This event occurs when the user modifies the contents of the edit box, then presses the enter key or moves the focus to a different window or control.
Sets the handler for the onselect event. This event occurs when the user sets or modifies the selected region of the text box.
Returns the width in characters.
Retrieves the width, in characters, of the edit box.
Returns true if the box is enabled; returns false if it is not.
Retrieves the enabled state of the edit box.
Returns the maximum input length, in characters.
Retrieves the current maximum input length for the edit. If this value is unset, it may be up to Integer.MAX_VALUE.
Returns true if editing of more than one line is allowed; otherwise, returns false.
Indicates if the edit control allows editing on more than one line or not. By default, only one line of editing is permitted and ENTER characters are ignored.
Indicates whether the edit control is being used for password input and must conceal its value.
Returns true if control is read-only; otherwise, returns false.
Retrieves the current read-only mode.
Returns number of rows.
Retrieves the current number of rows for a multiline edit box. Always returns 1 if style is not multiline.
Returns the name of the edit box.
Retrieves the name of the edit box, which is used for HTTP form submissions.
Returns the currently displayed string in the edit.
Retrieves the current text for the edit. For ES_PASSWORD style edit boxes, this is the actual string, not the mask.
Returns true if wrapping is active, otherwise false.
Retrieves the current wrapping mode.
Removes the handler for the onchange event. This event occurs when the user modifies the contents of the edit box, then presses the enter key or moves the focus to a different window or control.
Removes the handler for the onselect event. This event occurs when the user sets or modifies the selected region of the text box.
Sets the number of columns (characters) for the edit box width.
Sets the enabled state of the edit box.
Sets the input focus to this edit box
Sets the current maximum input length of the edit control in characters. This value is independent of the current column width, and only applies to password or single line edut boxes. Strings set from code can exceed this length; only user input is restricted.
Indicates if the edit control allows editing on more than one line or not. By default, only one line of editing is permitted and ENTER characters are ignored.
Specifies whether the edit control is being used for password input and must conceal its value. Password controls must be single line, so if this is set to true, then the Multiline property becomes false.
Sets the read-only mode for the edit control.
Sets the number of rows in a multiline edit box.
IllegalArgumentException Thrown if rows is less than or equal to 0
IllegalArgumentException Thrown if rows is greater than 1 and style is not multiline.
Sets the name of the edit box. Useful when submitting edit box content through an HTML form.
Sets the current text display of the edit box.
Sets the wrapping mode for a multiline edit box.