|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry.spec.BaseLocatable org.apache.tapestry.AbstractComponent org.apache.tapestry.form.AbstractFormComponent org.apache.tapestry.form.AbstractTextField org.apache.tapestry.valid.ValidField
public abstract class ValidField
A Form
component that creates a text field that
allows for validation of user input and conversion between string and object
values.
[Component Reference]
A ValidatingTextField uses an IValidationDelegate
to
track errors and an IValidator
to convert between strings and objects
(as well as perform validations). The validation delegate is shared by all validating
text fields in a form, the validator may be shared my multiple elements as desired.
Constructor Summary | |
---|---|
ValidField()
|
Method Summary | |
---|---|
protected void |
addSelect(IRequestCycle cycle)
Creates JavaScript to set the cursor on the first required or error field encountered while rendering. |
protected void |
beforeCloseTag(IMarkupWriter writer,
IRequestCycle cycle)
Invokes IValidationDelegate.writeAttributes(IMarkupWriter,IRequestCycle, IFormComponent,IValidator) . |
abstract String |
getDisplayName()
Implemented in some subclasses to provide a display name (suitable for presentation to the user as a label or error message). |
abstract IValidator |
getValidator()
|
abstract Object |
getValue()
|
protected String |
readValue()
Invoked by AbstractComponent.render(IMarkupWriter writer, IRequestCycle cycle)
when rendering a response. |
protected void |
renderComponent(IMarkupWriter writer,
IRequestCycle cycle)
Renders the component, which involves the delegate . |
abstract void |
setValue(Object value)
|
protected void |
updateValue(String value)
Invoked by AbstractComponent.render(IMarkupWriter writer, IRequestCycle cycle)
when a value is obtained from the
HttpServletRequest . |
Methods inherited from class org.apache.tapestry.form.AbstractTextField |
---|
isDisabled, isHidden |
Methods inherited from class org.apache.tapestry.form.AbstractFormComponent |
---|
getForm, getForm, getName, setForm, setName |
Methods inherited from class org.apache.tapestry.spec.BaseLocatable |
---|
getLocation, setLocation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tapestry.form.IFormComponent |
---|
getForm, getName, isDisabled, setName |
Methods inherited from interface org.apache.tapestry.IComponent |
---|
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification |
Methods inherited from interface org.apache.tapestry.IRender |
---|
render |
Methods inherited from interface org.apache.tapestry.ILocationHolder |
---|
setLocation |
Methods inherited from interface org.apache.tapestry.ILocatable |
---|
getLocation |
Constructor Detail |
---|
public ValidField()
Method Detail |
---|
public abstract Object getValue()
public abstract void setValue(Object value)
public abstract String getDisplayName()
AbstractFormComponent
getDisplayName
in interface IFormComponent
getDisplayName
in class AbstractFormComponent
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
delegate
.
During a render, the first field rendered that is either in error, or required but null gets special treatment. JavaScript is added to select that field (such that the cursor jumps right to the field when the page loads).
renderComponent
in class AbstractTextField
protected void beforeCloseTag(IMarkupWriter writer, IRequestCycle cycle)
IValidationDelegate.writeAttributes(IMarkupWriter,IRequestCycle, IFormComponent,IValidator)
.
beforeCloseTag
in class AbstractTextField
protected void addSelect(IRequestCycle cycle)
Body
component (which is almost always true).
protected String readValue()
AbstractTextField
AbstractComponent.render(IMarkupWriter writer, IRequestCycle cycle)
when rendering a response.
readValue
in class AbstractTextField
protected void updateValue(String value)
AbstractTextField
AbstractComponent.render(IMarkupWriter writer, IRequestCycle cycle)
when a value is obtained from the
HttpServletRequest
.
updateValue
in class AbstractTextField
public abstract IValidator getValidator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |