public abstract class AbstractForm
extends com.google.gwt.user.client.ui.Composite
Templated
widgets that require native form
support for asynchronous GET
or POST
requests.
Calls to submit()
trigger a form submission that is
null-routed and targets a hidden iframe.
The typical usage will be for login forms, where calling
submit()
after a successful login will prompt the
browser to remember a user's credentials.
If you use an AbstractForm
and still encounter issues getting proper
browser form support:
ClickHandler
that
calls AbstractForm
submit()
type="submit"
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_FORM_ACTION |
static String |
ERRAI_FORM_FRAME_ID |
Constructor and Description |
---|
AbstractForm() |
Modifier and Type | Method and Description |
---|---|
protected String |
getFormAction()
Subclasses may override this method if they want the form to submit to a
different url than
DEFAULT_FORM_ACTION . |
protected abstract com.google.gwt.dom.client.FormElement |
getFormElement() |
void |
submit()
Submit the form returned from
getFormElement() . |
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
public static final String DEFAULT_FORM_ACTION
public static final String ERRAI_FORM_FRAME_ID
protected String getFormAction()
DEFAULT_FORM_ACTION
.getFormElement()
action
attribute
before submission.public void submit()
getFormElement()
. Before
the form is submitted, it will be modifed so that it targets a hidden
iframe with the id ERRAI_FORM_FRAME_ID
with the
action
set to the return value of
getFormAction()
.protected abstract com.google.gwt.dom.client.FormElement getFormElement()
submit()
is called.Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.