org.apache.tapestry.form
Class FormComponentContributorContextImpl

java.lang.Object
  extended by org.apache.tapestry.form.ValidationMessagesImpl
      extended by org.apache.tapestry.form.FormComponentContributorContextImpl
All Implemented Interfaces:
FormComponentContributorContext, ValidationMessages

public class FormComponentContributorContextImpl
extends ValidationMessagesImpl
implements FormComponentContributorContext

Implementation of FormComponentContributorContext.

Since:
4.0
Author:
Howard Lewis Ship

Constructor Summary
FormComponentContributorContextImpl(java.util.Locale locale, IRequestCycle cycle, IFormComponent field)
           
 
Method Summary
 void addSubmitHandler(java.lang.String submitListener)
          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 class org.apache.tapestry.form.ValidationMessagesImpl
formatValidationMessage, getLocale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.tapestry.form.ValidationMessages
formatValidationMessage, getLocale
 

Constructor Detail

FormComponentContributorContextImpl

public FormComponentContributorContextImpl(java.util.Locale locale,
                                           IRequestCycle cycle,
                                           IFormComponent field)
Method Detail

includeClasspathScript

public void includeClasspathScript(java.lang.String path)
Description copied from interface: FormComponentContributorContext
Includes the indicated script; the path is a path on the classpath.

Specified by:
includeClasspathScript in interface FormComponentContributorContext

addSubmitHandler

public void addSubmitHandler(java.lang.String submitListener)
Description copied from interface: FormComponentContributorContext
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.

Specified by:
addSubmitHandler in interface FormComponentContributorContext

registerForFocus

public void registerForFocus(int priority)
Description copied from interface: FormComponentContributorContext
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.

Specified by:
registerForFocus in interface FormComponentContributorContext
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)