org.apache.tapestry
Interface IForm

All Superinterfaces:
FormBehavior, IComponent, IDirect, IDynamicInvoker, IRender, org.apache.hivemind.Locatable, org.apache.hivemind.LocationHolder
All Known Implementing Classes:
Form, Go

public interface IForm
extends IComponent, FormBehavior, IDirect

A generic way to access a component which defines an HTML form (or, perhaps, other similar constructs, such as a WML Go). This interface exists so that the IRequestCyclecan invoke the rewind(IMarkupWriter, IRequestCycle)method (which is used to deal with a Form that uses the direct service). In release 1.0.5, more responsibility for forms was moved here.

Since:
1.0.2
Author:
Howard Lewis Ship

Method Summary
 IValidationDelegate getDelegate()
          Returns the validation delegate for the form.
 boolean getFocus()
          Returns true if the form should support automatic field focus (that is, adding JavaScript to position the cursor into the first field of the form, automatically).
 String getName()
          Returns the name of the form.
 boolean isClientValidationEnabled()
          Indicates whether or not client-side validation will be generated during render.
 void rewind(IMarkupWriter writer, IRequestCycle cycle)
          Invoked by the IRequestCycleto allow a form that uses the direct service, to respond to the form submission.
 
Methods inherited from interface org.apache.tapestry.FormBehavior
addDeferredRunnable, addEventHandler, addHiddenValue, addHiddenValue, getElementId, getElementId, getProfile, isFormFieldUpdating, isRewinding, peekClientId, prerenderField, registerForFocus, setEncodingType, setFormFieldUpdating, wasPrerendered, wasPrerendered
 
Methods inherited from interface org.apache.tapestry.IDirect
isStateful, trigger
 
Methods inherited from interface org.apache.tapestry.IComponent
addAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getClientId, getComponent, getComponents, getContainedComponent, getContainer, getEventInvoker, getExtendedId, getId, getIdPath, getListeners, getMessages, getNamespace, getPage, getSpecification, getSpecifiedId, getTemplateTagName, isRendering, peekClientId, renderBody, setBinding, setClientId, setContainedComponent, setContainer, setId, setNamespace, setPage, setTemplateTagName
 
Methods inherited from interface org.apache.tapestry.IRender
render
 
Methods inherited from interface org.apache.hivemind.LocationHolder
setLocation
 
Methods inherited from interface org.apache.hivemind.Locatable
getLocation
 
Methods inherited from interface org.apache.tapestry.IDynamicInvoker
getUpdateComponents, isAsync, isJson
 

Method Detail

rewind

void rewind(IMarkupWriter writer,
            IRequestCycle cycle)
Invoked by the IRequestCycleto allow a form that uses the direct service, to respond to the form submission.


getName

String getName()
Returns the name of the form. The name is determined as the form component begins to render, but is not reset (as a convienience for building client-side JavaScript event handlers). The Form (and Go) components render this name as both the name and the id attribute (so it can be used like a field's clientId property.

Since:
1.0.5

getDelegate

IValidationDelegate getDelegate()
Returns the validation delegate for the form. Returns null if the form does not have a delegate.

Since:
1.0.8

isClientValidationEnabled

boolean isClientValidationEnabled()
Indicates whether or not client-side validation will be generated during render.

Returns:
true, if client-side validation is enabled, false otherwise
Since:
4.0

getFocus

boolean getFocus()
Returns true if the form should support automatic field focus (that is, adding JavaScript to position the cursor into the first field of the form, automatically). This requires that the Form component be enclosed by a Body component. When a single page contains multiple Forms, only the first Form that renders will get field focus; by setting the Form's focus parameter to false, it is possible to control which Form gets focus.

Since:
4.0


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