@Events(value={"toClient","validate","parseClient"}) public abstract class AbstractTextField extends AbstractField
Translator
(specified by the translate parameter, but often automatically derived by Tapestry) to be
augmented.
If the component container (i.e., the page) provides an event handler method for the "toclient" event, and that
handler returns a non-null string, that will be the string value sent to the client. The context passed to the event
handler method is t he current value of the value parameter.
Likewise, on a form submit, the "parseclient" event handler method will be passed the string provided by the client,
and may provide a non-null value as the parsed value. Returning null allows the normal translator to operate. The
event handler may also throw ValidationException
.Constructor and Description |
---|
AbstractTextField() |
Modifier and Type | Method and Description |
---|---|
protected String |
getWidth()
Looks for a
Width annotation and, if present, returns its value as a
string. |
protected boolean |
ignoreBlankInput()
Should blank input be ignored (after validation)? This will be true for
PasswordField . |
boolean |
isRequired()
Returns false; most components do not support declarative validation.
|
protected void |
processSubmission(String controlName)
Method implemented by subclasses to actually do the work of processing the submission of the form.
|
protected abstract void |
writeFieldTag(MarkupWriter writer,
String value)
Invoked from
begin(MarkupWriter) to write out the element and attributes (typically, <input>). |
decorateInsideField, getClientId, getControlName, getLabel, isDisabled, putPropertyNameIntoBeanValidationContext, removePropertyNameFromBeanValidationContext, setDecorator, setFormSupport
public AbstractTextField()
protected abstract void writeFieldTag(MarkupWriter writer, String value)
begin(MarkupWriter)
to write out the element and attributes (typically, <input>). The
controlName and clientId
properties will already have been set or updated.
Generally, the subclass will invoke MarkupWriter.element(String, Object[])
, and will be responsible for
including an AfterRender
phase method to invoke MarkupWriter.end()
.writer
- markup write to send output tovalue
- the value (either obtained and translated from the value parameter, or obtained from the tracker)protected void processSubmission(String controlName)
AbstractField
disabled
.processSubmission
in class AbstractField
controlName
- the control name of the rendered element (used to find the correct parameter in the request)protected boolean ignoreBlankInput()
PasswordField
.public boolean isRequired()
AbstractField
isRequired
in interface Field
isRequired
in class AbstractField
Copyright © 2003-2012 The Apache Software Foundation.