Provides initialization of the clientId and elementName properties. In addition, adds the
Method from org.apache.tapestry5.corelib.base.AbstractField Detail: |
final void afterDecorator() {
decorator.afterField(this);
}
Allows the validation decorator to write markup after the field has written all of its markup. |
final void beforeDecorator() {
decorator.beforeField(this);
}
Allows the validation decorator to write markup before the field itself writes markup. |
protected final Binding createDefaultParameterBinding(String parameterName) {
return defaultProvider.defaultBinding(parameterName, resources);
}
Used by subclasses to create a default binding to a property of the container matching the component id. |
protected final void decorateInsideField() {
decorator.insideField(this);
}
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. |
final String defaultLabel() {
return defaultProvider.defaultLabel(resources);
}
|
public final String getClientId() {
return assignedClientId;
}
|
public final String getControlName() {
return controlName;
}
|
public final String getLabel() {
return label;
}
|
public final boolean isDisabled() {
return disabled;
}
|
public boolean isRequired() {
return false;
}
Returns false; most components do not support declarative validation. |
abstract protected void processSubmission(String elementName)
Method implemented by subclasses to actually do the work of processing the submission of the form. The element's
elementName property will already have been set. This method is only invoked if the field is not disabled . |
protected final void setDecorator(ValidationDecorator decorator) {
this.decorator = decorator;
}
|
protected final void setFormSupport(FormSupport formSupport) {
this.formSupport = formSupport;
}
|
final void setup() {
// By default, use the component id as the (base) client id. If the clientid
// parameter is bound, then that is the value to use.
String id = clientId;
// Often, these controlName and clientId will end up as the same value. There are many
// exceptions, including a form that renders inside a loop, or a form inside a component
// that is used multiple times.
if (formSupport == null) throw new RuntimeException(InternalMessages.formFieldOutsideForm(getLabel()));
assignedClientId = renderSupport.allocateClientId(id);
String controlName = formSupport.allocateControlName(id);
formSupport.storeAndExecute(this, new Setup(controlName));
formSupport.store(this, PROCESS_SUBMISSION_ACTION);
}
|