Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gwtext.client.widgets.form
Class Form

    java.lang.Object
      com.gwtext.client.core.JsObject
          com.gwtext.client.widgets.form.Form

    public class Form

extends JsObject

Form widget.

Field Summary

Fields inherited from class com.gwtext.client.core.JsObject
`jsObj`

Constructor Summary
`Form(com.google.gwt.core.client.JavaScriptObject jsObj)`

Method Summary
`void` | `add(Field field)` Add a Field to the current open container (e.g.
`void` | `addListener(FormListener listener)` Add a Form listener.
`void` | `clearInvalid()` Clears all invalid messages in this form.
`protected com.google.gwt.core.client.JavaScriptObject` | `create(com.google.gwt.core.client.JavaScriptObject config)`
`Field` | `findField(java.lang.String id)` Find a `Field` in this form by id, dataIndex, name or hiddenName.
`java.lang.String` | `getValues()` Returns the fields in this form as a String
`static Form` | `instance(com.google.gwt.core.client.JavaScriptObject formJS)`
`boolean` | `isDirty()` Returns true if any fields in this form have changed since their original load.
`boolean` | `isValid()` Returns true if client-side validation on the form is successful.
`void` | `load(java.lang.String url)`
`void` | `load(java.lang.String url, UrlParam[] params, Connection.Method method, java.lang.String waitMsg)`
`void` | `loadRecord(Record record)` Loads a `Record` into this form.
`void` | `remove(Field field)` Removes a field from the items collection (does NOT remove its markup).
`void` | `reset()` Resets this form.
`void` | `submit()` Shortcut to do a submit action.
`void` | `submit(java.lang.String url)` Submit the form.
`void` | `submit(java.lang.String url, UrlParam[] params, Connection.Method method, java.lang.String waitMsg, boolean clientValidation)` Subit the form.
`void` | `updateRecord(Record record)` Persists the values in this Form into the passed Record object.

Methods inherited from class com.gwtext.client.core.JsObject
`getJsObj, getProperties, isCreated, setJsObj`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Form

    public Form(com.google.gwt.core.client.JavaScriptObject jsObj)

Method Detail

### create

    protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)

### instance

    public static Form instance(com.google.gwt.core.client.JavaScriptObject formJS)

### add

    public void add(Field field)

  Add a Field to the current open container (e.g. column, fieldset, etc.).

  Parameters:
    `field` - the field to add

### clearInvalid

    public void clearInvalid()

  Clears all invalid messages in this form.

### findField

    public Field findField(java.lang.String id)

  Find a `Field` in this form by id, dataIndex, name or hiddenName.

  Parameters:
    `id` - the field ID,dataIndex, name or hiddenName to search for
  Returns:
    the field

### getValues

    public java.lang.String getValues()

  Returns the fields in this form as a String

  Returns:
    form vield values as String

### isDirty

    public boolean isDirty()

  Returns true if any fields in this form have changed since their original load.

  Returns:
    true if dirty

### isValid

    public boolean isValid()

  Returns true if client-side validation on the form is successful.

  Returns:
    true if valid

### load

    public void load(java.lang.String url)

### load

    public void load(java.lang.String url,
                     UrlParam[] params,
                     Connection.Method method,
                     java.lang.String waitMsg)

### loadRecord

    public void loadRecord(Record record)

  Loads a `Record` into this form. The name of the Fields in the `RecordDef` must match the names of the Fields in the From.

  Parameters:
    `record` - the Record to load

### remove

    public void remove(Field field)

  Removes a field from the items collection (does NOT remove its markup).

  Parameters:
    `field` - the field to remove

### reset

    public void reset()

  Resets this form.

### submit

    public void submit()

  Shortcut to do a submit action.
  Note When calling this method to submit the form and have registered a `FormListener` to process the return value, the rerun value must conform the to format specified by the `FormPanel.setErrorReader(com.gwtext.client.data.Reader)`. The `FormListener`'s onActionComplete and onActionFailed callbacks are invoked based on what the errorReader translated the return value. The default errorReader is a JSONReader which expects the return value to be in the format

       {"success":false,"errors":[{"id":"email","msg":"Already exists"}, {"id":"username","msg":"Already taken"}]}

  . If your return data format is different, you have two options :
  - Explicitly specify your own errorReader
  - Do not call this method to submit the form. Instead, call `getValues()` to fetch the form values, and then use GWT's `RequestBuilder` or GWT-RPC to submit the form values and you can process the return data yourself in the callback.

### submit

    public void submit(java.lang.String url)

  Submit the form.
  Note When calling this method to submit the form and have registered a `FormListener` to process the return value, the rerun value must conform the to format specified by the `FormPanel.setErrorReader(com.gwtext.client.data.Reader)`. The `FormListener`'s onActionComplete and onActionFailed callbacks are invoked based on what the errorReader translated the return value. The default errorReader is a JSONReader which expects the return value to be in the format

       {"success":false,"errors":[{"id":"email","msg":"Already exists"}, {"id":"username","msg":"Already taken"}]}

  . If your return data format is different, you have two options :
  - Explicitly specify your own errorReader
  - Do not call this method to submit the form. Instead, call `getValues()` to fetch the form values, and then use GWT's `RequestBuilder` or GWT-RPC to submit the form values and you can process the return data yourself in the callback.

  Parameters:
    `url` - the url to sumbit to

### submit

    public void submit(java.lang.String url,
                       UrlParam[] params,
                       Connection.Method method,
                       java.lang.String waitMsg,
                       boolean clientValidation)

  Subit the form.
  Note When calling this method to submit the form and have registered a `FormListener` to process the return value, the rerun value must conform the to format specified by the `FormPanel.setErrorReader(com.gwtext.client.data.Reader)`. The `FormListener`'s onActionComplete and onActionFailed callbacks are invoked based on what the errorReader translated the return value. The default errorReader is a JSONReader which expects the return value to be in the format

       {"success":false,"errors":[{"id":"email","msg":"Already exists"}, {"id":"username","msg":"Already taken"}]}

  . If your return data format is different, you have two options :
  - Explicitly specify your own errorReader
  - Do not call this method to submit the form. Instead, call `getValues()` to fetch the form values, and then use GWT's `RequestBuilder` or GWT-RPC to submit the form values and you can process the return data yourself in the callback.

  Parameters:
    `url` - the url to submit to
    `params` - additional params to submit
    `method` - the submit method
    `waitMsg` - the wait message
    `clientValidation` - pass true to call form.isValid() prior to posting to validate the form on the client (defaults to false)
  See Also:
    `Connection.GET`, `Connection.POST`

### updateRecord

    public void updateRecord(Record record)

  Persists the values in this Form into the passed Record object.

  Parameters:
    `record` - the record to edit

### addListener

    public void addListener(FormListener listener)

  Add a Form listener.

  Parameters:
    `listener` - the form listener

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD