|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.gwtext.client.widgets.Component
com.gwtext.client.widgets.BoxComponent
com.gwtext.client.widgets.Container
com.gwtext.client.widgets.Panel
com.gwtext.client.widgets.form.FormPanel
public class FormPanel
FormPanel uses a FormLayout
internally, and that is required for fields and labels
to work correctly within the FormPanel's layout. To nest additional layout styles within a FormPanel, you should nest
additional Panels or other containers that can provide additional layout functionality. You should not override FormPanel's layout.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary |
---|
Fields inherited from class com.gwtext.client.widgets.Component |
---|
config, id |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
FormPanel()
Create a new FormPanel. |
|
FormPanel(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
FormPanel(Position labelAlign)
Create a new FormPanel. |
Method Summary | |
---|---|
void |
addFormListener(FormListener listener)
Add a Form listener. |
void |
addListener(FormPanelListener listener)
Add a Form Panel Listener. |
protected com.google.gwt.core.client.JavaScriptObject |
create(com.google.gwt.core.client.JavaScriptObject config)
|
protected com.google.gwt.core.client.JavaScriptObject |
getConfigPrototype()
|
Field[] |
getFields()
Return all fields added to the FormPanel. |
Form |
getForm()
Provides access to the Form which this Panel contains. |
java.lang.String |
getXType()
Gets the xtype for this component as registered with ComponentMgr. |
protected void |
initComponent()
This template method is called after the Component has been instantiated but before it's rendered. |
void |
setBaseParams(UrlParam[] params)
Parameters to pass with all requests. |
void |
setButtonAlign(Position buttonAlign)
Valid values are "left," "center" and "right" (defaults to "center"). |
void |
setErrorReader(Reader errorReader)
A Reader (e.g. |
void |
setFileUpload(boolean fileUpload)
Set true if this form is a file upload. |
void |
setHideLabels(boolean hideLabels)
Set to true to hide all field labels. |
void |
setItemCls(java.lang.String itemCls)
A CSS class to apply to the x-form-item of fields. |
void |
setLabelAlign(Position labelAlign)
Valid values are "left," "top" and "right" (defaults to "left"). |
void |
setLabelWidth(int labelWidth)
The width of labels. |
void |
setMethod(Connection.Method method)
The request method to use (GET or POST) for form actions if one isn't supplied in the action options. |
void |
setMinButtonWidth(int minButtonWidth)
Minimum width of all buttons in pixels (defaults to 75). |
void |
setMonitorPoll(int monitorPoll)
The milliseconds to poll valid state, ignored if monitorValid is not true (defaults to 200). |
void |
setMonitorValid(boolean monitorValid)
If true the form monitors its valid state client-side and fires a looping event with that state. |
void |
setReader(Reader reader)
A Reader (e.g. |
void |
setTimeout(int timeout)
Timeout for form actions in seconds (default is 30 seconds). |
void |
setTrackResetOnLoad(boolean trackResetOnLoad)
If set to true, form.reset() resets to the last loaded or setValues() data instead of when the form was first created. |
void |
setUrl(java.lang.String url)
The URL to use for form actions if one isn't supplied in the action options. |
void |
setWaitMsgTarget(boolean waitMsgTarget)
By default wait messages are displayed with Object.wait(long) . |
void |
setWaitMsgTarget(java.lang.String waitMsgTarget)
By default wait messages are displayed with Object.wait(long) . |
void |
startMonitoring()
Starts monitoring of the valid state of this form. |
void |
stopMonitoring()
Stops monitoring of the valid state of this form. |
Methods inherited from class com.gwtext.client.widgets.Container |
---|
add, add, add, add, addListener, bubble, cascade, clear, doLayout, doLayout, findBy, findByID, findByType, getActiveItem, getActiveItemID, getAutoDestroy, getBufferResize, getComponent, getComponent, getComponents, getHideBorders, getItems, getLayout, getMonitorResize, insert, iterator, remove, remove, remove, remove, removeAll, removeAll, setActiveItem, setActiveItemID, setAutoDestroy, setBufferResize, setDefaults, setHideBorders, setLayout, setMonitorResize |
Methods inherited from class com.gwtext.client.widgets.BoxComponent |
---|
addListener, doOnRender, doOnRender, getAutoHeight, getAutoWidth, getBox, getBox, getHeight, getPosition, getPosition, getSize, getWidth, setAutoHeight, setAutoWidth, setHeight, setHeight, setPagePosition, setPosition, setSize, setSize, setWidth, setWidth, syncSize, updateBox |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, setElement, setPixelSize, setStyleName, setStyleName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FormPanel()
public FormPanel(Position labelAlign)
labelAlign
- the label alignmentpublic FormPanel(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
protected com.google.gwt.core.client.JavaScriptObject getConfigPrototype()
getConfigPrototype
in class Panel
public java.lang.String getXType()
Component
TextField field = new TextField();
field.getXType() returns "textfield"
getXType
in class Panel
protected void initComponent()
Component
initComponent
in class Component
protected com.google.gwt.core.client.JavaScriptObject create(com.google.gwt.core.client.JavaScriptObject config)
create
in class Panel
public void startMonitoring()
public void stopMonitoring()
public Form getForm()
addFormListener(com.gwtext.client.widgets.form.event.FormListener)
instead.
public Field[] getFields()
public void addFormListener(FormListener listener)
Form
directly, this method is useful to call when you would like to add a FormListener prior to the FormPaanel being rendered.
listener
- the form listenerpublic void addListener(FormPanelListener listener)
listener
- the listenerpublic void setBaseParams(UrlParam[] params) throws java.lang.IllegalStateException
params
- the base params
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setButtonAlign(Position buttonAlign) throws java.lang.IllegalStateException
setButtonAlign
in class Panel
buttonAlign
- form button position
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setErrorReader(Reader errorReader) throws java.lang.IllegalStateException
Reader
(e.g. XmlReader
) to be used to read data when reading validation errors on "submit" actions.
This is completely optional as there is built-in support for processing JSON. The default JSON error reader expects the return value to be in the format
{"success":false,"errors":[{"id":"email","msg":"Already exists"}, {"id":"username","msg":"Already taken"}]}
If the response is in XML format, one can set an XMLReader.
//setup error reader to process from submit response from server
RecordDef errorRecordDef = new RecordDef(new FieldDef[]{
new StringFieldDef("id"),
new StringFieldDef("msg")
});
XmlReader errorReader = new XmlReader("field", errorRecordDef);
errorReader.setSuccess("@success");
and the corresponding XML return value must be in the format :
<response success="false"> <errors> <field> <id>email</id> <msg><![CDATA[ Invalid email. <br /><i>Already exists </i> ]]></msg> </field> <field> <id>username</id> <msg><![CDATA[ Invalid Username. <br /><i>Already taken </i> ]]></msg> </field> </errors> </response>
errorReader
- the error reader
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setFileUpload(boolean fileUpload) throws java.lang.IllegalStateException
fileUpload
- true if file upload
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setHideLabels(boolean hideLabels) throws java.lang.IllegalStateException
hideLabels
- true to hide field labels
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setItemCls(java.lang.String itemCls) throws java.lang.IllegalStateException
itemCls
- CSS class
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setLabelAlign(Position labelAlign) throws java.lang.IllegalStateException
labelAlign
- label alignment
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setLabelWidth(int labelWidth) throws java.lang.IllegalStateException
labelWidth
- the label width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMethod(Connection.Method method) throws java.lang.IllegalStateException
method
- the request method
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMinButtonWidth(int minButtonWidth) throws java.lang.IllegalStateException
setMinButtonWidth
in class Panel
minButtonWidth
- min button width
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMonitorPoll(int monitorPoll) throws java.lang.IllegalStateException
monitorPoll
- the monitor poll in milliseconds
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setMonitorValid(boolean monitorValid) throws java.lang.IllegalStateException
monitorValid
- true to enable monitoring
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setReader(Reader reader) throws java.lang.IllegalStateException
Reader
(e.g. XmlReader
) to be used to read data when executing "load" actions.
This is optional as there is built-in support for processing JSON.
reader
- the load Reader
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTimeout(int timeout) throws java.lang.IllegalStateException
timeout
- timeout in seconds
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setTrackResetOnLoad(boolean trackResetOnLoad) throws java.lang.IllegalStateException
trackResetOnLoad
- true to track reset on load
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setUrl(java.lang.String url) throws java.lang.IllegalStateException
url
- the url
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setWaitMsgTarget(java.lang.String waitMsgTarget) throws java.lang.IllegalStateException
Object.wait(long)
.
You can target a specific element by passing its id.
waitMsgTarget
- ID of the Element to mask
java.lang.IllegalStateException
- this property cannot be changed after the Component has been renderedpublic void setWaitMsgTarget(boolean waitMsgTarget) throws java.lang.IllegalStateException
Object.wait(long)
.
You can mask the form itself by passing in true.
waitMsgTarget
- true to mask the form
java.lang.IllegalStateException
- this property cannot be changed after the Component has been rendered
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |