public class Form extends ComplexWidget implements com.google.gwt.user.client.ui.impl.FormPanelImplHost
<b:Form>...</b:Form>
| Modifier and Type | Class and Description |
|---|---|
static class |
Form.SubmitCompleteEvent
Fired when a form has been submitted successfully.
|
static interface |
Form.SubmitCompleteHandler
Handler for
Form.SubmitCompleteEvent events. |
static class |
Form.SubmitEvent
Fired when the form is submitted.
|
static interface |
Form.SubmitHandler
Handler for
Form.SubmitEvent events. |
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| Modifier | Constructor and Description |
|---|---|
|
Form()
Creates an empty form.
|
|
Form(boolean createIFrame) |
protected |
Form(com.google.gwt.dom.client.Element element,
boolean createIFrame)
This constructor may be used by subclasses to explicitly use an existing
element.
|
| Modifier and Type | Method and Description |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addSubmitCompleteHandler(Form.SubmitCompleteHandler handler)
Adds a
Form.SubmitCompleteEvent handler. |
com.google.gwt.event.shared.HandlerRegistration |
addSubmitHandler(Form.SubmitHandler handler)
Adds a
Form.SubmitEvent handler. |
String |
getAction()
Gets the 'action' associated with this form.
|
String |
getEncoding()
Gets the encoding used for submitting this form.
|
String |
getMethod()
Gets the HTTP method used for submitting this form.
|
String |
getTarget() |
protected void |
onAttach() |
protected void |
onDetach() |
boolean |
onFormSubmit() |
void |
onFrameLoad() |
void |
reset()
Resets the form, clearing all fields.
|
void |
setAction(com.google.gwt.safehtml.shared.SafeUri url)
Sets the 'action' associated with this form.
|
void |
setAction(String url)
Sets the 'action' associated with this form.
|
void |
setEncoding(String encodingType)
Sets the encoding used for submitting this form.
|
void |
setMethod(String method)
Sets the HTTP method used for submitting this form.
|
void |
setTarget(String target) |
void |
setType(FormType type)
Sets the type of the form.
|
void |
submit()
Submits the form.
|
add, addStyle, insert, removeStyle, setHideOn, setShowOn, setStyleadd, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeadd, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onLoad, onUnload, removeFromParent, setLayoutData, setParent, sinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEventspublic Form()
public Form(boolean createIFrame)
protected Form(com.google.gwt.dom.client.Element element,
boolean createIFrame)
If the createIFrame parameter is set to true, then the
wrapped form's target attribute will be set to a hidden iframe. If not,
the form's target will be left alone, and the FormSubmitComplete event
will not be fired.
element - the element to be usedcreateIFrame - true to create an <iframe> element that
will be targeted by this formpublic com.google.gwt.event.shared.HandlerRegistration addSubmitCompleteHandler(Form.SubmitCompleteHandler handler)
Form.SubmitCompleteEvent handler.handler - the handlerpublic com.google.gwt.event.shared.HandlerRegistration addSubmitHandler(Form.SubmitHandler handler)
Form.SubmitEvent handler.handler - the handlerpublic String getAction()
public String getEncoding()
#ENCODING_MULTIPART or #ENCODING_URLENCODED.public String getMethod()
#METHOD_GET or #METHOD_POST.public String getTarget()
public void setType(FormType type)
type - the form's typepublic void reset()
public void setAction(String url)
url - the form's actionpublic void setAction(com.google.gwt.safehtml.shared.SafeUri url)
url - the form's actionpublic void setEncoding(String encodingType)
FormPanel.ENCODING_MULTIPART or FormPanel.ENCODING_URLENCODED.encodingType - the form's encodingpublic void setMethod(String method)
FormPanel.METHOD_GET or FormPanel.METHOD_POST.method - the form's methodpublic void submit()
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.
protected void onAttach()
onAttach in class com.google.gwt.user.client.ui.Widgetprotected void onDetach()
onDetach in class com.google.gwt.user.client.ui.Widgetpublic void setTarget(String target)
public boolean onFormSubmit()
onFormSubmit in interface com.google.gwt.user.client.ui.impl.FormPanelImplHostpublic void onFrameLoad()
onFrameLoad in interface com.google.gwt.user.client.ui.impl.FormPanelImplHostCopyright © 2016. All rights reserved.