com.sencha.gxt.widget.core.client.form
Class FormPanel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.sencha.gxt.widget.core.client.Component
              extended by com.sencha.gxt.widget.core.client.container.Container
                  extended by com.sencha.gxt.widget.core.client.container.ResizeContainer
                      extended by com.sencha.gxt.widget.core.client.container.SimpleContainer
                          extended by com.sencha.gxt.widget.core.client.form.FormPanel
All Implemented Interfaces:
HasAttachHandlers, HasResizeHandlers, HasHandlers, EventListener, AcceptsOneWidget, HasOneWidget, HasVisibility, HasWidgets, HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.impl.FormPanelImplHost, IndexedPanel, IndexedPanel.ForIsWidget, IsWidget, ProvidesResize, RequiresResize, HasLayout, AddEvent.HasAddHandlers, BeforeAddEvent.HasBeforeAddHandlers, BeforeHideEvent.HasBeforeHideHandlers, BeforeRemoveEvent.HasBeforeRemoveHandlers, BeforeShowContextMenuEvent.HasBeforeShowContextMenuHandler, BeforeShowEvent.HasBeforeShowHandlers, BlurEvent.HasBlurHandlers, ContainerHandler.HasContainerHandlers, DisableEvent.HasDisableHandlers, EnableEvent.HasEnableHandlers, FocusEvent.HasFocusHandlers, HideEvent.HasHideHandlers, MoveEvent.HasMoveHandlers, RemoveEvent.HasRemoveHandlers, ShowContextMenuEvent.HasShowContextMenuHandler, ShowEvent.HasShowHandlers, SubmitCompleteEvent.HasSubmitCompleteHandlers, SubmitEvent.HasSubmitHandlers, HasFocusSupport, HasItemId, Iterable<Widget>

public class FormPanel
extends SimpleContainer
implements com.google.gwt.user.client.ui.impl.FormPanelImplHost, SubmitEvent.HasSubmitHandlers, SubmitCompleteEvent.HasSubmitCompleteHandlers


Nested Class Summary
static class FormPanel.Encoding
          Form encoding enumeration.
static class FormPanel.LabelAlign
          Label alignment enumeration.
static class FormPanel.Method
          Form method enumeration.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
IndexedPanel.ForIsWidget
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
FormPanel()
           
 
Method Summary
 HandlerRegistration addSubmitCompleteHandler(SubmitCompleteEvent.SubmitCompleteHandler handler)
          Adds a SubmitCompleteEvent handler.
 HandlerRegistration addSubmitHandler(SubmitEvent.SubmitHandler handler)
          Adds a SubmitEvent handler.
 String getAction()
          Gets the 'action' associated with this form.
 String getEncoding()
          Gets the encoding used for submitting this form.
 List<FieldLabel> getFieldLabels()
          Returns all of the panel's child field labels.
 List<IsField<?>> getFields()
          Returns all of the panel's child fields.
 FormPanel.LabelAlign getLabelAlign()
           
 int getLabelWidth()
           
 FormPanel.Method getMethod()
          Returns the form's method.
 String getTarget()
          Gets the form's 'target'.
 boolean isValid()
          Returns true if the form is invalid.
 boolean isValid(boolean preventMark)
          Returns the form's valid state by querying all child fields.
 boolean onFormSubmit()
           
 void onFrameLoad()
           
 void reset()
          Resets all field values.
 void setAction(SafeUri url)
          Sets the 'action' associated with this form.
 void setAction(String url)
          Sets the action of the form.
 void setEncoding(FormPanel.Encoding encoding)
           
 void setLabelAlign(FormPanel.LabelAlign align)
           
 void setLabelWidth(int labelWidth)
           
 void setMethod(FormPanel.Method method)
          Specifies if the form will be submitted using an HTTP Post or Get request (defaults to GET).
 void submit()
          Submits the form.
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.SimpleContainer
add, add, getWidget, isResize, setResize, setWidget, setWidget
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.ResizeContainer
forceLayout, isLayoutRunning, isOrWasLayoutRunning, onResize
 
Methods inherited from class com.sencha.gxt.widget.core.client.container.Container
add, addAddHandler, addBeforeAddHandler, addBeforeRemoveHandler, addContainerHandler, addRemoveHandler, clear, disable, enable, findWidget, getItemByItemId, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, iterator, remove, remove, remove
 
Methods inherited from class com.sencha.gxt.widget.core.client.Component
addBeforeHideHandler, addBeforeShowContextMenuHandler, addBeforeShowHandler, addBlurHandler, addDisableHandler, addEnableHandler, addFocusHandler, addHideHandler, addMoveHandler, addResizeHandler, addShowContextMenuHandler, addShowHandler, addStyleOnOver, clearSizeCache, disableEvents, enableEvents, fireEvent, focus, getData, getElement, getFocusSupport, getHideMode, getId, getItemId, getOffsetHeight, getOffsetWidth, getShadow, getStateId, getToolTip, hide, hideToolTip, isAllowTextSelection, isAutoHeight, isAutoWidth, isDeferHeight, isEnabled, isRendered, isStateful, isVisible, isVisible, mask, mask, onBrowserEvent, removeToolTip, setAllowTextSelection, setBorders, setBounds, setBounds, setContextMenu, setData, setDeferHeight, setEnabled, setHeight, setHeight, setHideMode, setId, setItemId, setPagePosition, setPixelSize, setPosition, setShadow, setSize, setStateful, setStateId, setTabIndex, setToolTip, setToolTipConfig, setVisible, setWidth, setWidth, show, sync, syncSize, unmask
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, getLayoutData, getParent, isAttached, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, removeStyleDependentName, removeStyleName, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FormPanel

public FormPanel()
Method Detail

addSubmitCompleteHandler

public HandlerRegistration addSubmitCompleteHandler(SubmitCompleteEvent.SubmitCompleteHandler handler)
Adds a SubmitCompleteEvent handler.

Specified by:
addSubmitCompleteHandler in interface SubmitCompleteEvent.HasSubmitCompleteHandlers
Parameters:
handler - the handler
Returns:
the handler registration used to remove the handler

addSubmitHandler

public HandlerRegistration addSubmitHandler(SubmitEvent.SubmitHandler handler)
Adds a SubmitEvent handler.

Specified by:
addSubmitHandler in interface SubmitEvent.HasSubmitHandlers
Parameters:
handler - the handler
Returns:
the handler registration used to remove the handler

getAction

public String getAction()
Gets the 'action' associated with this form. This is the URL to which it will be submitted.

Returns:
the form's action

getEncoding

public String getEncoding()
Gets the encoding used for submitting this form. This should be either FormPanel.Encoding.MULTIPART or FormPanel.Encoding.URLENCODED.

Returns:
the form's encoding

getFieldLabels

public List<FieldLabel> getFieldLabels()
Returns all of the panel's child field labels. Field labels in nested containers are included in the returned list.

Returns:
the fields

getFields

public List<IsField<?>> getFields()
Returns all of the panel's child fields. Fields in nested containers are included in the returned list.

Returns:
the fields

getLabelAlign

public FormPanel.LabelAlign getLabelAlign()

getLabelWidth

public int getLabelWidth()

getMethod

public FormPanel.Method getMethod()
Returns the form's method. Only applies when using standard HTML form submits.

Returns:
the method the method

getTarget

public String getTarget()
Gets the form's 'target'. This is the name of the NamedFrame that will receive the results of submission, or null if none has been specified.

Returns:
the form's target.

isValid

public boolean isValid()
Returns true if the form is invalid.

Returns:
true if all fields are valid

isValid

public boolean isValid(boolean preventMark)
Returns the form's valid state by querying all child fields.

Parameters:
preventMark - true for silent validation (no invalid event and field is not marked invalid)
Returns:
true if all fields are valid

onFormSubmit

public boolean onFormSubmit()
Specified by:
onFormSubmit in interface com.google.gwt.user.client.ui.impl.FormPanelImplHost

onFrameLoad

public void onFrameLoad()
Specified by:
onFrameLoad in interface com.google.gwt.user.client.ui.impl.FormPanelImplHost

reset

public void reset()
Resets all field values.


setAction

public void setAction(SafeUri url)
Sets the 'action' associated with this form. This is the URL to which it will be submitted.

Parameters:
url - the form's action

setAction

public void setAction(String url)
Sets the action of the form.

Parameters:
url - the action

setEncoding

public void setEncoding(FormPanel.Encoding encoding)

setLabelAlign

public void setLabelAlign(FormPanel.LabelAlign align)

setLabelWidth

public void setLabelWidth(int labelWidth)

setMethod

public void setMethod(FormPanel.Method method)
Specifies if the form will be submitted using an HTTP Post or Get request (defaults to GET).

Parameters:
method - the method

submit

public void submit()
Submits the form.

The FormPanel must not be detached (i.e. removed from its parent or otherwise disconnected from a RootPanel) until the submission is complete. Otherwise, notification of submission will fail.



Copyright © 2012. All Rights Reserved.