@SupportsInformalParameters public abstract class AbstractField extends Object implements Field
RenderInformals
,
and DiscardBody
mixins.Name | Type | Flags | Default | Default Prefix |
---|---|---|---|---|
clientId | String | literal | ||
Used to explicitly set the client-side id of the element for this component. Normally this is not bound (or null) and org.apache.tapestry5.services.javascript.JavaScriptSupport#allocateClientId(org.apache.tapestry5.ComponentResources) is used to generate a unique client-id based on the component's id. In some cases, when creating client-side behaviors, it is useful to explicitly set a unique id for an element using this parameter. Certain values, such as "submit", "method", "reset", etc., will cause client-side conflicts and are not allowed; using such will cause a runtime exception. | ||||
ensureClientIdUnique | boolean | Since 5.4 | prop | |
A rarely used option that indicates that the actual client id should start with the clientId parameter (if non-null) but should still pass that Id through org.apache.tapestry5.services.javascript.JavaScriptSupport#allocateClientId(String) to generate the final id. An example of this are the components used inside a org.apache.tapestry5.corelib.components.BeanEditor which will specify a clientId (based on the property name) but still require that it be unique. Defaults to false. |
Modifier and Type | Field and Description |
---|---|
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() |
String |
getControlName() |
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
@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()
getClientId
in interface ClientElement
public final String getControlName()
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()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.