Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 // Copyright 2004, 2005 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
 //     http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.apache.tapestry;
A generic way to access a component which defines an HTML form (or, perhaps, other similar constructs, such as a WML org.apache.tapestry.wml.Go). This interface exists so that the IRequestCyclecan invoke the rewind(org.apache.tapestry.IMarkupWriter,org.apache.tapestry.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.

Author(s):
Howard Lewis Ship
Since:
1.0.2
public interface IForm extends IComponentFormBehaviorIDirect
{
    
Invoked by the IRequestCycleto allow a form that uses the direct service, to respond to the form submission.
    void rewind(IMarkupWriter writerIRequestCycle cycle);

    
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
    String getName();

    
Returns the validation delegate for the form. Returns null if the form does not have a delegate.

Since:
1.0.8
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
    boolean isClientValidationEnabled();

    
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 org.apache.tapestry.html.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
    boolean getFocus();
New to GrepCode? Check out our FAQ X