|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gwtext.client.core.JsObject
com.gwtext.client.widgets.form.Form
public class Form
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 |
---|
public Form(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
public static Form instance(com.google.gwt.core.client.JavaScriptObject formJS)
public void add(Field field)
field
- the field to addpublic void clearInvalid()
public Field findField(java.lang.String id)
Field
in this form by id, dataIndex, name or hiddenName.
id
- the field ID,dataIndex, name or hiddenName to search for
public java.lang.String getValues()
public boolean isDirty()
public boolean isValid()
public void load(java.lang.String url)
public void load(java.lang.String url, UrlParam[] params, Connection.Method method, java.lang.String waitMsg)
public void loadRecord(Record record)
Record
into this form. The name of the Fields in the RecordDef
must match the names of the Fields in the From.
record
- the Record to loadpublic void remove(Field field)
field
- the field to removepublic void reset()
public void submit()
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 :
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.
public void submit(java.lang.String url)
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 :
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.
url
- the url to sumbit topublic void submit(java.lang.String url, UrlParam[] params, Connection.Method method, java.lang.String waitMsg, boolean clientValidation)
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 :
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.
url
- the url to submit toparams
- additional params to submitmethod
- the submit methodwaitMsg
- the wait messageclientValidation
- pass true to call form.isValid() prior to posting to validate the form on the client (defaults to false)Connection.GET
,
Connection.POST
public void updateRecord(Record record)
record
- the record to editpublic void addListener(FormListener listener)
listener
- the form listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |