|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.domui.dom.css.CssBase
to.etc.domui.dom.html.NodeBase
to.etc.domui.dom.html.Input
to.etc.domui.component.input.Text<T>
public class Text<T>
A single-line input box. This extends the "input" tag with validation ability and methods to handle conversions and labels.
Nested Class Summary | |
---|---|
static class |
Text.NumberMode
|
Constructor Summary | |
---|---|
Text(java.lang.Class<T> inputClass)
|
Method Summary | |
---|---|
boolean |
acceptRequestParameter(java.lang.String[] values)
Handle the input from the request for this component. |
void |
addValidator(java.lang.Class<? extends IValueValidator<T>> clz)
|
void |
addValidator(java.lang.Class<? extends IValueValidator<T>> clz,
java.lang.String[] parameters)
|
void |
addValidator(IValueValidator<?> v)
|
void |
addValidator(PropertyMetaValidator v)
|
IBinder |
bind()
Return the binder for this control. |
void |
clearMessage()
Clear message and reset validated flag, so next getValue would result with new validation check. |
IConverter<T> |
getConverter()
See IConvertable.getConverter() . |
java.lang.Class<T> |
getInputClass()
Returns the datatype of the value of this control, as passed in the constructor. |
Text.NumberMode |
getNumberMode()
Returns the current numeric mode in effect. |
java.lang.String |
getRegexpUserString()
|
java.lang.String |
getValidationRegexp()
|
T |
getValue()
Returns the current value of this input component. |
T |
getValueSafe()
Like IDisplayControl.getValue() this returns the value of the component, but this returns null
if the value was invalid. |
boolean |
hasError()
Return T if this node currently has an error associated with it. |
boolean |
isBound()
Returns T if this control is bound to some data value. |
boolean |
isMandatory()
Returns T if this control is mandatory. |
boolean |
isModified()
Returns the modified-by-user flag. |
boolean |
isUntrimmed()
Returns T if the input is to be left untrimmed. |
void |
setConverter(IConverter<T> converter)
See IConvertable.setConverter(IConverter) . |
void |
setMandatory(boolean mandatory)
Set the control as mandatory. |
void |
setModified(boolean as)
Set or clear the modified by user flag. |
void |
setNumberMode(Text.NumberMode numberMode)
Sets the current numeric mode in effect. |
void |
setRegexpUserString(java.lang.String regexpUserString)
|
void |
setUntrimmed(boolean untrimmed)
Specify whether the input is to be space-trimmed before being used. |
void |
setValidationRegexp(java.lang.String validationRegexp)
|
void |
setValue(T value)
Set a new value in this component. |
boolean |
validate()
Main handler to validate input. |
Methods inherited from class to.etc.domui.dom.html.Input |
---|
componentHandleWebAction, getInputType, getMaxLength, getOnKeyPressJS, getOnLookupTyping, getOnValueChanged, getRawValue, getSize, isDisabled, isReadOnly, setDisabled, setMaxLength, setOnKeyPressJS, setOnLookupTyping, setOnValueChanged, setRawValue, setReadOnly, setSize, visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface to.etc.domui.dom.html.IControl |
---|
getErrorLocation, isDisabled, isReadOnly, setErrorLocation, setReadOnly |
Methods inherited from interface to.etc.domui.dom.html.IDisplayControl |
---|
setTestID |
Methods inherited from interface to.etc.domui.dom.html.IActionControl |
---|
setDisabled, setTestID |
Methods inherited from interface to.etc.domui.dom.html.IHasChangeListener |
---|
getOnValueChanged, setOnValueChanged |
Methods inherited from interface to.etc.domui.dom.errors.INodeErrorDelegate |
---|
getMessage, setMessage |
Constructor Detail |
---|
public Text(java.lang.Class<T> inputClass)
Method Detail |
---|
public boolean acceptRequestParameter(java.lang.String[] values)
acceptRequestParameter
in class Input
Input.acceptRequestParameter(java.lang.String[])
public boolean validate()
public java.lang.Class<T> getInputClass()
public IConverter<T> getConverter()
IConvertable.getConverter()
.
This returns null if no converter has been set. It also returns null if a default converter is used.
getConverter
in interface IConvertable<T>
public void setConverter(IConverter<T> converter)
IConvertable.setConverter(IConverter)
.
Sets the Converter to use to convert the string value to a T and vice versa. It is the programmer's
responsibility to ensure that the converter actually converts to a T; if not the code will throw
ClassCastExceptions.
setConverter
in interface IConvertable<T>
converter
- public T getValue()
IDisplayControl
ValidationException
. This means that this
call either delivers correct input (as defined by it's converter and validators), null
(when empty) or throws an exception. When a ValidationException occurs the framework
mostly ignores it - it does not produce a stacktrace or error in the client. Instead
the resulting error as posted by the error handling framework gets displayed on the
form when the request completes.
To get the value of a component while ignoring exceptions call #getValueSafe()
.
getValue
in interface IDisplayControl<T>
IDisplayControl.getValue()
public void clearMessage()
clearMessage
in interface INodeErrorDelegate
clearMessage
in class NodeBase
NodeBase.clearMessage()
public T getValueSafe()
IControl
IDisplayControl.getValue()
this returns the value of the component, but this returns null
if the value was invalid. For this method NULL either means the value was invalid OR
it's content was empty. To distinguish between the two call IControl.hasError()
or use
IDisplayControl.getValue()
instead of this call.
getValueSafe
in interface IControl<T>
IControl.getValueSafe()
public boolean hasError()
NodeBase
hasError
in interface IControl<T>
hasError
in class NodeBase
IControl.hasError()
public void setValue(T value)
setValue
in interface IDisplayControl<T>
IDisplayControl.setValue(java.lang.Object)
public boolean isMandatory()
isMandatory
in interface IControl<T>
IControl.isMandatory()
public void setMandatory(boolean mandatory)
setMandatory
in interface IControl<T>
IControl.setMandatory(boolean)
public boolean isUntrimmed()
public void setUntrimmed(boolean untrimmed)
untrimmed
- public Text.NumberMode getNumberMode()
public void setNumberMode(Text.NumberMode numberMode)
numberMode
- public void addValidator(IValueValidator<?> v)
public void addValidator(PropertyMetaValidator v)
public void addValidator(java.lang.Class<? extends IValueValidator<T>> clz)
public void addValidator(java.lang.Class<? extends IValueValidator<T>> clz, java.lang.String[] parameters)
public java.lang.String getValidationRegexp()
public void setValidationRegexp(java.lang.String validationRegexp)
public java.lang.String getRegexpUserString()
public void setRegexpUserString(java.lang.String regexpUserString)
public boolean isModified()
isModified
in interface IHasModifiedIndication
IHasModifiedIndication.isModified()
public void setModified(boolean as)
setModified
in interface IHasModifiedIndication
IHasModifiedIndication.setModified(boolean)
public IBinder bind()
bind
in interface IBindable
IBindable.bind()
public boolean isBound()
isBound
in interface IBindable
IBindable.isBound()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |