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 addSubmitListener(java.lang.String submitListener)
          Adds initialization to register a submitListener on the client side.
 java.lang.String getFieldDOM()
          Returns a client-side DOM reference for the field for which contributions are being rendered.
 void includeClasspathScript(java.lang.String path)
          Includes the indicated script; the path is a path on the classpath.
 
Methods inherited from interface org.apache.tapestry.form.ValidationMessages
formatValidationMessage
 

Method Detail

getFieldDOM

java.lang.String getFieldDOM()
Returns a client-side DOM reference for the field for which contributions are being rendered. Typically a value such as "document.myform.myfield".


includeClasspathScript

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


addSubmitListener

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

Parameters:
submitListener - either the name of a submit listener ("myListener"), or an inline implementation of a listener function ("function(event) { ... } ").