org.apache.tapestry.form
Interface RequirableField

All Superinterfaces:
IComponent, IFormComponent, IRender, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
All Known Implementing Classes:
AbstractRequirableField, PropertySelection, RadioGroup, Select, Upload

public interface RequirableField
extends IFormComponent

Implemented by form components that can be marked as required. The form rewind will record validation errors for required fields for which a value was not submitted.

Since:
4.0
Author:
Paul Ferraro

Method Summary
 void bind(IMarkupWriter writer, IRequestCycle cycle)
          Called on the field if the required field check succeeds.
 java.lang.String getRequiredMessage()
          Returns the custom validation message pattern that overrides the default one.
 java.lang.String getSubmittedValue(IRequestCycle cycle)
          Retrieves a simplified view of the value submitted for this component.
 boolean isRequired()
          Indicates whether or not this field is required.
 
Methods inherited from interface org.apache.tapestry.form.IFormComponent
getClientId, getDisplayName, getForm, getName, isDisabled, setName
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getExtendedId, getId, getIdPath, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 

Method Detail

isRequired

boolean isRequired()
Indicates whether or not this field is required.

Returns:
true, if this field is required, false otherwise.

getRequiredMessage

java.lang.String getRequiredMessage()
Returns the custom validation message pattern that overrides the default one. This value may include MessageFormat parameters, the context of which is specific to this field.

Returns:
a custom validation message

bind

void bind(IMarkupWriter writer,
          IRequestCycle cycle)
          throws ValidatorException
Called on the field if the required field check succeeds.

Throws:
ValidatorException - if required field check fails.

getSubmittedValue

java.lang.String getSubmittedValue(IRequestCycle cycle)
Retrieves a simplified view of the value submitted for this component. Used during required field checking.