@SupportsInformalParameters public abstract class AbstractField extends Object implements Field
RenderInformals
,
and DiscardBody
mixins.Modifier and Type | Field and Description |
---|---|
protected String |
clientId
The id used to generate a page-unique client-side identifier for the component.
|
protected String |
cssClass |
protected ValidationDecorator |
decorator |
protected ComponentDefaultProvider |
defaultProvider |
protected boolean |
disabled
If true, then the field will render out with a disabled attribute
(to turn off client-side behavior).
|
protected Environment |
environment |
protected FieldValidationSupport |
fieldValidationSupport |
protected FormSupport |
formSupport |
protected JavaScriptSupport |
javaScriptSupport |
protected String |
label
The user presentable label for the field.
|
protected Request |
request |
protected ComponentResources |
resources |
protected ValidationTracker |
validationTracker |
Constructor and Description |
---|
AbstractField() |
Modifier and Type | Method and Description |
---|---|
protected void |
decorateInsideField()
Invoked from subclasses after they have written their tag and (where appropriate) their informal parameters
and have allowed their
Validator to write markup as well. |
String |
getClientId()
Returns a unique id for the element.
|
String |
getControlName()
Returns the value used as the name attribute of the rendered element.
|
String |
getLabel()
Returns a user presentable (localized) label for the field, which may be used inside <label> elements on
the client, and inside client or server-side validation error messages.
|
boolean |
isDisabled()
Returns true if the field is disabled; A disabled field will render a disabled attribute so that it is
non-responsive on the client (at least, until its disabled status is changed on the client using JavaScript).
|
boolean |
isRequired()
Returns false; most components do not support declarative validation.
|
protected abstract void |
processSubmission(String controlName)
Method implemented by subclasses to actually do the work of processing the submission of the form.
|
protected void |
putPropertyNameIntoBeanValidationContext(String parameterName) |
protected void |
removePropertyNameFromBeanValidationContext() |
protected void |
setDecorator(ValidationDecorator decorator) |
protected void |
setFormSupport(FormSupport formSupport) |
@Parameter(defaultPrefix="literal") protected String label
@Parameter(value="false") protected boolean disabled
@Environmental protected ValidationDecorator decorator
@Inject protected Environment environment
@Parameter(value="prop:componentResources.id", defaultPrefix="literal") protected String clientId
clientId property
.@Environmental(value=false) protected FormSupport formSupport
@Environmental protected JavaScriptSupport javaScriptSupport
@Environmental protected ValidationTracker validationTracker
@Inject protected ComponentResources resources
@Inject protected ComponentDefaultProvider defaultProvider
@Inject protected FieldValidationSupport fieldValidationSupport
public AbstractField()
public final String getLabel()
Field
public final String getClientId()
ClientElement
getClientId
in interface ClientElement
public final String getControlName()
Field
getControlName
in interface Field
FormSupport.allocateControlName(String)
public final boolean isDisabled()
Field
isDisabled
in interface Field
protected abstract void processSubmission(String controlName)
disabled
.controlName
- the control name of the rendered element (used to find the correct parameter in the request)protected final void decorateInsideField()
Validator
to write markup as well.protected final void setDecorator(ValidationDecorator decorator)
protected final void setFormSupport(FormSupport formSupport)
public boolean isRequired()
isRequired
in interface Field
protected void putPropertyNameIntoBeanValidationContext(String parameterName)
protected void removePropertyNameFromBeanValidationContext()
Copyright © 2003-2013 The Apache Software Foundation.