org.apache.tapestry.form
Interface FormComponentContributorContext

All Superinterfaces:
ValidationMessages
All Known Implementing Classes:
FormComponentContributorContextImpl

public interface FormComponentContributorContext
extends ValidationMessages

Object that provides support to objects that implement FormComponentContributor. For the moment, at least, this is all about client-side JavaScript generation.

TODO: Having support for regular expressions might be useful (and would allow a single {@link RegexpMatcher to be shared).

Since:
4.0
Author:
Howard Lewis Ship

Method Summary
 void addSubmitHandler(java.lang.String handler)
          Adds initialization to register a submit handler on the client side.
 void includeClasspathScript(java.lang.String path)
          Includes the indicated script; the path is a path on the classpath.
 void registerForFocus(int priority)
          Registers a field for automatic focus.
 
Methods inherited from interface org.apache.tapestry.form.ValidationMessages
formatValidationMessage, getLocale
 

Method Detail

includeClasspathScript

public void includeClasspathScript(java.lang.String path)
Includes the indicated script; the path is a path on the classpath.


addSubmitHandler

public void addSubmitHandler(java.lang.String handler)
Adds initialization to register a submit handler on the client side. A submit handler is a JavaScript method that accepts a single parameter, a (JavaScript) FormSubmitEvent.


registerForFocus

public void registerForFocus(int priority)
Registers a field for automatic focus. The goal is for the first field that is in error to get focus; failing that, the first required field; failing that, any field.

Parameters:
priority - a priority level used to determine whether the registered field becomes the focus field. Constants for this purpose are defined in ValidationConstants.
See Also:
FormBehavior.registerForFocus(IFormComponent, int)