org.apache.tapestry.form
Class ValidatableFieldSupportImpl

java.lang.Object
  extended by org.apache.tapestry.form.ValidatableFieldSupportImpl
All Implemented Interfaces:
ValidatableFieldSupport

public class ValidatableFieldSupportImpl
extends Object
implements ValidatableFieldSupport

Default ValidatableFieldSupport implementation. This implementation generates calls to a static javascript function during render if client-side validation is enabled.

Since:
4.0
Author:
Paul Ferraro

Constructor Summary
ValidatableFieldSupportImpl()
           
 
Method Summary
protected  Iterator getValidatorsIterator(ValidatableField component)
           
 boolean isRequired(ValidatableField field)
          Returns true if this component is required.
 void renderContributions(ValidatableField component, IMarkupWriter writer, IRequestCycle cycle)
          Called during render of the specified component.
 void setThreadLocale(org.apache.hivemind.service.ThreadLocale threadLocale)
           
 void setValueConverter(ValueConverter converter)
           
 void validate(ValidatableField component, IMarkupWriter writer, IRequestCycle cycle, Object object)
          Called during rewind of the specified component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatableFieldSupportImpl

public ValidatableFieldSupportImpl()
Method Detail

setValueConverter

public void setValueConverter(ValueConverter converter)

setThreadLocale

public void setThreadLocale(org.apache.hivemind.service.ThreadLocale threadLocale)

getValidatorsIterator

protected Iterator getValidatorsIterator(ValidatableField component)

renderContributions

public void renderContributions(ValidatableField component,
                                IMarkupWriter writer,
                                IRequestCycle cycle)
Description copied from interface: ValidatableFieldSupport
Called during render of the specified component. Renders any contributions from validators.

Specified by:
renderContributions in interface ValidatableFieldSupport
See Also:
ValidatableFieldSupport.renderContributions(ValidatableField, IMarkupWriter, IRequestCycle)

validate

public void validate(ValidatableField component,
                     IMarkupWriter writer,
                     IRequestCycle cycle,
                     Object object)
              throws ValidatorException
Description copied from interface: ValidatableFieldSupport
Called during rewind of the specified component. Specified value is validated using the component's validators.

Specified by:
validate in interface ValidatableFieldSupport
Throws:
ValidatorException - if validation fails
See Also:
ValidatableFieldSupport.validate(org.apache.tapestry.form.ValidatableField, org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle, java.lang.Object)

isRequired

public boolean isRequired(ValidatableField field)
Description copied from interface: ValidatableFieldSupport
Returns true if this component is required. This usually entails a search of the component's validators.

Specified by:
isRequired in interface ValidatableFieldSupport


Copyright © 2006-2008 Apache Software Foundation. All Rights Reserved.