org.apache.tapestry.form
Class AbstractFormComponentContributor

java.lang.Object
  extended byorg.apache.tapestry.form.AbstractFormComponentContributor
All Implemented Interfaces:
FormComponentContributor
Direct Known Subclasses:
AbstractTranslator

public abstract class AbstractFormComponentContributor
extends java.lang.Object
implements FormComponentContributor

Abstract FormComponentContributor implementation that adds an optional static javscript method reference to the page.

Since:
4.0
Author:
Paul Ferraro

Constructor Summary
AbstractFormComponentContributor()
           
AbstractFormComponentContributor(java.lang.String initializer)
           
 
Method Summary
protected  java.lang.String defaultScript()
          Defines the default JavaScript file used by this contributor.
 java.lang.String getScript()
           
 void renderContribution(IMarkupWriter writer, IRequestCycle cycle, FormComponentContributorContext context, IFormComponent field)
          Invoked by a form component after it finishes rendering its tag (but before the tag is closed) to allow this object to contribute to the component's rendering process.
 void setScript(java.lang.String script)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFormComponentContributor

public AbstractFormComponentContributor()

AbstractFormComponentContributor

public AbstractFormComponentContributor(java.lang.String initializer)
Method Detail

defaultScript

protected java.lang.String defaultScript()
Defines the default JavaScript file used by this contributor. Overriden by most subclasses that use JavaScript.


getScript

public java.lang.String getScript()

setScript

public void setScript(java.lang.String script)

renderContribution

public void renderContribution(IMarkupWriter writer,
                               IRequestCycle cycle,
                               FormComponentContributorContext context,
                               IFormComponent field)
Description copied from interface: FormComponentContributor
Invoked by a form component after it finishes rendering its tag (but before the tag is closed) to allow this object to contribute to the component's rendering process. Typically used by Validators and Translators to add javascript methods to the form's submit event handler.

Specified by:
renderContribution in interface FormComponentContributor
Parameters:
writer - allows contributor to write additional attributes into the component's tag
cycle - for accessing request information
context - utilities for genering messages and client-side validation
field - the field for which contributions are being rendered
See Also:
FormComponentContributor.renderContribution(org.apache.tapestry.IMarkupWriter, org.apache.tapestry.IRequestCycle, FormComponentContributorContext, org.apache.tapestry.form.IFormComponent)