Filter:   InfoImg
download FormEventType.java
Language: Java
LOC: 21
Project Info
Tapestry: Java Web Components(tapestry)
Server: SourceForge
Type: cvs
[Show Code]
[Show Code]
...k\src\net\sf\tapestry\form\
   AbstractFormComponent.java
   AbstractTextField.java
   Button.java
   Button.jwc
   Checkbox.java
   Checkbox.jwc
   DatePicker.html
   DatePicker.java
   DatePicker.js
   DatePicker.jwc
   DatePicker.script
   ...ertySelectionModel.java
   Form.java
   Form.jwc
   FormEventType.java
   Hidden.java
   Hidden.jwc
   IFormComponent.java
   ImageSubmit.java
   ImageSubmit.jwc
   ...ertySelectionModel.java
   ...ySelectionRenderer.java
   ListEdit.java
   ListEdit.jwc
   Option.java
   Option.jwc
   package.html
   PropertySelection.java
   PropertySelection.jwc
   Radio.java
   Radio.jwc
   RadioGroup.java
   RadioGroup.jwc
   ...ySelectionRenderer.java
   Select.java
   Select.jwc
   ...ySelectionRenderer.java
   ...ertySelectionModel.java
   Submit.java
   Submit.jwc
   TextArea.java
   TextArea.jwc
   TextField.java
   TextField.jwc
   Upload.java
   Upload.jwc

package net.sf.tapestry.form;

import org.apache.commons.lang.enum.Enum;

/**
 *  Lists different types of JavaScript events that can be associated
 *  with a {@link Form} via {@link Form#addEventHandler(FormEventType, String)}.
 *
 *  @author Howard Lewis Ship
 *  @version $Id: FormEventType.java,v 1.5 2002/11/27 17:58:47 hship Exp $
 *  @since 1.0.2
 **/

public class FormEventType extends Enum
{
    /**
     *  Form event triggered when the form is submitted.  Allows an event handler
     *  to perform any final changes before the results are posted to the server.
     *
     *  <p>The JavaScript method should return <code>true</code> or
     * <code>false</code>.  If there are multiple event handlers for the form
     * they will be combined using the binary and operator (<code>&amp;&amp;</code>).
     *
     **/

    public static final FormEventType SUBMIT = new FormEventType("SUBMIT", "onsubmit");

    /**
     *  Form event triggered when the form is reset; this allows an event handler
     *  to deal with any special cases related to resetting.
     *
     **/

    public static final FormEventType RESET = new FormEventType("RESET", "onreset");

    private String _propertyName;

    private FormEventType(String name, String propertyName)
    {
        super(name);

        _propertyName = propertyName;
    }

    /** 
     *  Returns the DOM property corresponding to event type (used when generating
     *  client-side scripting).
     *
     **/

    public String getPropertyName()
    {
        return _propertyName;
    }

    /**
     *  Returns true if multiple functions should be combined
     *  with the <code>&amp;&amp;</code> operator.  Otherwise,
     *  the event handler functions are simply invoked
     *  sequentially (as a series of JavaScript statements).
     *
     **/

    public boolean getCombineUsingAnd()
    {
        return this == FormEventType.SUBMIT;
    }
}