public abstract class AbstractForm extends FormElementContainer implements FormPanelImplHost
Modifier and Type | Class and Description |
---|---|
static class |
AbstractForm.SubmitCompleteEvent
Fired when a form has been submitted successfully.
|
static interface |
AbstractForm.SubmitCompleteHandler
Handler for
AbstractForm.SubmitCompleteEvent events. |
static class |
AbstractForm.SubmitEvent
Fired when the form is submitted.
|
static interface |
AbstractForm.SubmitHandler
Handler for
AbstractForm.SubmitEvent events. |
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
IndexedPanel.ForIsWidget
HasWidgets.ForIsWidget
DEBUG_ID_PREFIX
Modifier | Constructor and Description |
---|---|
|
AbstractForm() |
|
AbstractForm(boolean createIFrame) |
protected |
AbstractForm(Element element,
boolean createIFrame)
This constructor may be used by subclasses to explicitly use an existing
element.
|
Modifier and Type | Method and Description |
---|---|
HandlerRegistration |
addSubmitCompleteHandler(AbstractForm.SubmitCompleteHandler handler)
Adds a
AbstractForm.SubmitCompleteEvent handler. |
HandlerRegistration |
addSubmitHandler(AbstractForm.SubmitHandler handler)
Adds a
AbstractForm.SubmitEvent handler. |
String |
getAction()
Gets the 'action' associated with this form.
|
protected List<HasValidators<?>> |
getChildrenWithValidators(Widget widget)
Get this forms child input elements with validators.
|
String |
getEncoding()
Gets the encoding used for submitting this form.
|
String |
getMethod()
Gets the HTTP method used for submitting this form.
|
String |
getTarget()
Gets the form's 'target'.
|
boolean |
isSubmitOnEnter() |
protected void |
onAttach() |
protected void |
onDetach() |
boolean |
onFormSubmit() |
void |
onFrameLoad() |
void |
reset()
Resets form
|
void |
setAction(SafeUri url)
Sets the 'action' associated with this form.
|
void |
setAction(String action)
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 |
setSubmitOnEnter(boolean submitOnEnter) |
void |
submit()
Submits form
|
boolean |
validate() |
boolean |
validate(boolean show) |
add, setHiddenOn, setVisibleOn
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public AbstractForm()
public AbstractForm(boolean createIFrame)
protected AbstractForm(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 boolean onFormSubmit()
onFormSubmit
in interface FormPanelImplHost
public void onFrameLoad()
onFrameLoad
in interface FormPanelImplHost
public HandlerRegistration addSubmitCompleteHandler(AbstractForm.SubmitCompleteHandler handler)
AbstractForm.SubmitCompleteEvent
handler.handler
- the handlerpublic HandlerRegistration addSubmitHandler(AbstractForm.SubmitHandler handler)
AbstractForm.SubmitEvent
handler.handler
- the handlerpublic String getAction()
public void setAction(String action)
action
- the form's actionpublic void setAction(SafeUri url)
url
- the form's actionpublic String getMethod()
#METHOD_GET
or #METHOD_POST
.public void setMethod(String method)
#METHOD_GET
or #METHOD_POST
.method
- the form's methodpublic String getTarget()
NamedFrame
that
will receive the results of submission, or null
if none has
been specified.public String getEncoding()
#ENCODING_MULTIPART
or #ENCODING_URLENCODED
.public void setEncoding(String encodingType)
#ENCODING_MULTIPART
or #ENCODING_URLENCODED
.encodingType
- the form's encodingpublic void submit()
public void reset()
public boolean validate()
public boolean validate(boolean show)
protected List<HasValidators<?>> getChildrenWithValidators(Widget widget)
widget
- the widgetpublic void setSubmitOnEnter(boolean submitOnEnter)
public boolean isSubmitOnEnter()
Copyright © 2017. All rights reserved.