net.sf.click.extras.control
Class TelephoneField
java.lang.Object
net.sf.click.control.AbstractControl
net.sf.click.control.Field
net.sf.click.control.TextField
net.sf.click.extras.control.TelephoneField
- All Implemented Interfaces:
- Serializable, Control
public class TelephoneField
- extends TextField
Provides a Telephone Field control: <input type='text'>.
TelephoneField will validate the telephone number when the control is
processed and invoke the control listener if defined.
The TelephoneField uses a JavaScript onkeypress() noLetterFilter() method to prevent
users from entering invalid characters. To enable number key filtering
reference $jsImports and $cssImports in your page
template. For example:
<html>
<head>
$cssImports
</head>
<body>
$form
</body>
</html>
$jsImports
See also W3C HTML reference
INPUT
- Author:
- Malcolm Edgar
- See Also:
- Serialized Form
| Fields inherited from class net.sf.click.control.Field |
disabled, error, focus, form, help, label, readonly, required, tabindex, title, validate, value |
|
Method Summary |
void |
validate()
Validate the TelephoneField request submission. |
| Methods inherited from class net.sf.click.control.TextField |
getControlSizeEst, getMaxLength, getMinLength, getSize, getTag, getType, getValidationJavaScript, render, setMaxLength, setMinLength, setSize |
| 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, 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, setParent, setStyle, toString |
TelephoneField
public TelephoneField(String name)
- Construct the TelephoneField with the given name. The default text field
size is 20 characters and the minium valid length is 10 characters.
- Parameters:
name - the name of the field
TelephoneField
public TelephoneField(String name,
boolean required)
- Construct the TelephoneField with the given name and required status.
The default text field size is 20 characters and the minium valid length
is 10 characters.
- Parameters:
name - the name of the fieldrequired - the field required status
TelephoneField
public TelephoneField(String name,
String label)
- Construct the TelephoneField with the given name and label. The default
text field size is 20 characters and the minium valid length is 10
characters.
- Parameters:
name - the name of the fieldlabel - the label of the field
TelephoneField
public TelephoneField(String name,
String label,
boolean required)
- Construct the TelephoneField with the given name, label and required
status. The default text field size is 20 characters and the minium valid
length is 10 characters.
- Parameters:
name - the name of the fieldlabel - the label of the fieldrequired - the field required status
TelephoneField
public TelephoneField(String name,
String label,
int size)
- Construct the TelephoneField with the given name, label and size.
The default the minium valid length is 10 characters.
- Parameters:
name - the name of the fieldlabel - the label of the fieldsize - the size of the field
TelephoneField
public TelephoneField()
- Create a TelephoneField with no name defined. The default the minium
valid length is 10 characters.
Please note the control's name must be defined before it is valid.
validate
public void validate()
- Validate the TelephoneField request submission.
A field error message is displayed if a validation error occurs.
These messages are defined in the resource bundle:
- /click-control.properties
- field-maxlength-error
- field-minlength-error
- field-required-error
- /net/sf/click/extras/control/TelephoneField.properties
- Overrides:
validate in class TextField