public interface Input extends WComponent, Disableable, Mandatable, DataBound, BeanBound, BeanProviderBound, Labelable, Diagnosable
DEFAULT_APPLICATION_ID, DEFAULT_INTERNAL_ID, DEFAULT_NO_ID, ID_CONTEXT_SEPERATOR, ID_FRAMEWORK_ASSIGNED_SEPERATOR, ID_VALIDATION_PATTERN
Modifier and Type | Method and Description |
---|---|
void |
addValidator(FieldValidator validator)
Adds a validator to the input field.
|
String |
getActionCommand()
Same as {#getValueAsString()}.
|
Object |
getActionObject()
Returns the data object that has been associated with this input component, else null.
|
Action |
getActionOnChange() |
WButton |
getDefaultSubmitButton() |
Object |
getRequestValue(Request request)
Provide the value of the component on the Request.
|
Iterator<FieldValidator> |
getValidators() |
Object |
getValue()
Provide the value of the component returned by
DataBound.getData() in the correct format. |
String |
getValueAsString()
Retrieves a String representation of the input field's value.
|
boolean |
isChangedInLastRequest()
Indicates if the input component was changed in the last request.
|
boolean |
isEmpty()
Indicates whether this input field is empty.
|
boolean |
isReadOnly()
Indicates whether the input is read only in the given context.
|
void |
setActionObject(Object data)
Associates this input with a data object that can be easily accessed in the execute() method of the associated
Action.
|
void |
setActionOnChange(Action actionOnChange)
Sets the action that you want run if the input is changed by the user.
|
void |
setDefaultSubmitButton(WButton defaultSubmitButton)
Sets the button that should be submitted when the user hits enter key and cursor is inside this input field.
|
void |
setMandatory(boolean mandatory,
String message)
Set whether or not this input is mandatory, and customise the error message that will be displayed.
|
void |
setReadOnly(boolean readOnly)
Sets whether the input is read only.
|
isDisabled, setDisabled
isMandatory, setMandatory
isSearchAncestors, setBean
getBeanId, setBeanId, setBeanProvider
getBean, getBeanProperty, getBeanValue, setBeanProperty
getDiagnostics
addHtmlClass, addHtmlClass, forward, getAccessibleText, getAttribute, getBaseUrl, getEnvironment, getHeaders, getHtmlClass, getHtmlClasses, getId, getIdName, getInternalId, getLabel, getName, getParent, getTabIndex, getTag, getToolTip, handleRequest, hasTabIndex, invokeLater, isDefaultState, isHidden, isInitialised, isLocked, isTracking, isTrackingEnabled, isValidate, isVisible, paint, preparePaint, removeAttribute, removeHtmlClass, removeHtmlClass, reset, serviceRequest, setAccessibleText, setAttribute, setEnvironment, setFocussed, setHtmlClass, setHtmlClass, setIdName, setInitialised, setLocked, setTag, setToolTip, setTrackingEnabled, setValidate, setVisible, showErrorIndicators, showWarningIndicators, tidyUpUIContextForTree, validate
void addValidator(FieldValidator validator)
ValidatingAction
or an explicit call to WComponent.validate(List)
will trigger validation on a
WComponent tree.validator
- the validator to add.Iterator<FieldValidator> getValidators()
void setActionOnChange(Action actionOnChange)
actionOnChange
- the action to execute when the input is changed by the user.Action getActionOnChange()
Object getActionObject()
void setActionObject(Object data)
data
- the data object.String getActionCommand()
void setDefaultSubmitButton(WButton defaultSubmitButton)
defaultSubmitButton
- the default submit button for this field.WButton getDefaultSubmitButton()
void setMandatory(boolean mandatory, String message)
mandatory
- true for mandatory, false for optional.message
- the message to display to the user on mandatory validation failure.boolean isReadOnly()
void setReadOnly(boolean readOnly)
readOnly
- if true, the input is read only. If false, it is editable.Object getRequestValue(Request request)
If the component is not on the request, the components current value will be provided.
request
- the request being responded to.Object getValue()
DataBound.getData()
in the correct format.
If required, this method can convert the data into the correct type and also do any validation before the value is used.
DataBound.getData()
in the correct format.String getValueAsString()
boolean isEmpty()
boolean isChangedInLastRequest()
Copyright © 2021. All rights reserved.