|
||||||||||
| 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.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.SimplePanel
com.google.gwt.user.client.ui.FormPanel
public class FormPanel
A panel that wraps its contents in an HTML <FORM> element.
This panel can be used to achieve interoperability with servers that accept
traditional HTML form encoding. The following widgets (those that implement
HasName) will be submitted to the
server if they are contained within this panel:
TextBoxPasswordTextBoxRadioButtonSimpleRadioButtonCheckBoxSimpleCheckBoxTextAreaListBoxFileUploadHiddenFileUpload is
only useful when used within a FormPanel, because the browser will
only upload files using form submission.
| Nested Class Summary | |
|---|---|
static class |
FormPanel.SubmitCompleteEvent
Fired when a form has been submitted successfully. |
static interface |
FormPanel.SubmitCompleteHandler
Handler for FormPanel.SubmitCompleteEvent events. |
static class |
FormPanel.SubmitEvent
Fired when the form is submitted. |
static interface |
FormPanel.SubmitHandler
Handler for FormPanel.SubmitEvent events. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary | |
|---|---|
static java.lang.String |
ENCODING_MULTIPART
Used with setEncoding(String) to specify that the form will be
submitted using MIME encoding (necessary for FileUpload to work
properly). |
static java.lang.String |
ENCODING_URLENCODED
Used with setEncoding(String) to specify that the form will be
submitted using traditional URL encoding. |
static java.lang.String |
METHOD_GET
Used with setMethod(String) to specify that the form will be
submitted using an HTTP GET request. |
static java.lang.String |
METHOD_POST
Used with setMethod(String) to specify that the form will be
submitted using an HTTP POST request (necessary for FileUpload to
work properly). |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
FormPanel()
Creates a new FormPanel. |
|
FormPanel(NamedFrame frameTarget)
Creates a FormPanel that targets a NamedFrame. |
|
FormPanel(java.lang.String target)
Creates a new FormPanel. |
|
| Method Summary | |
|---|---|
void |
addFormHandler(FormHandler handler)
Deprecated. Use addSubmitCompleteHandler(com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler) and
addSubmitHandler(com.google.gwt.user.client.ui.FormPanel.SubmitHandler) instead |
HandlerRegistration |
addSubmitCompleteHandler(FormPanel.SubmitCompleteHandler handler)
Adds a FormPanel.SubmitCompleteEvent handler. |
HandlerRegistration |
addSubmitHandler(FormPanel.SubmitHandler handler)
Adds a FormPanel.SubmitEvent handler. |
java.lang.String |
getAction()
Gets the 'action' associated with this form. |
java.lang.String |
getEncoding()
Gets the encoding used for submitting this form. |
java.lang.String |
getMethod()
Gets the HTTP method used for submitting this form. |
java.lang.String |
getTarget()
Gets the form's 'target'. |
boolean |
onFormSubmit()
Fired when a form is submitted. |
void |
onFrameLoad()
Called when the target frame is done loading. |
void |
removeFormHandler(FormHandler handler)
Deprecated. Use the HandlerRegistration.removeHandler() method on the
object returned by and add*Handler method instead |
void |
reset()
Resets the form, clearing all fields. |
void |
setAction(java.lang.String url)
Sets the 'action' associated with this form. |
void |
setEncoding(java.lang.String encodingType)
Sets the encoding used for submitting this form. |
void |
setMethod(java.lang.String method)
Sets the HTTP method used for submitting this form. |
void |
submit()
Submits the form. |
static FormPanel |
wrap(Element element)
Creates a FormPanel that wraps an existing <form> element. |
static FormPanel |
wrap(Element element,
boolean createIFrame)
Creates a FormPanel that wraps an existing <form> element. |
| Methods inherited from class com.google.gwt.user.client.ui.SimplePanel |
|---|
add, getWidget, iterator, remove, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Panel |
|---|
clear |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String ENCODING_MULTIPART
setEncoding(String) to specify that the form will be
submitted using MIME encoding (necessary for FileUpload to work
properly).
public static final java.lang.String ENCODING_URLENCODED
setEncoding(String) to specify that the form will be
submitted using traditional URL encoding.
public static final java.lang.String METHOD_GET
setMethod(String) to specify that the form will be
submitted using an HTTP GET request.
public static final java.lang.String METHOD_POST
setMethod(String) to specify that the form will be
submitted using an HTTP POST request (necessary for FileUpload to
work properly).
| Constructor Detail |
|---|
public FormPanel()
FormPanel.SubmitCompleteHandler.
The back-end server is expected to respond with a content-type of
'text/html', meaning that the text returned will be treated as HTML. If any
other content-type is specified by the server, then the result HTML sent in
the onFormSubmit event will be unpredictable across browsers, and the
onSubmitComplete event may not fire at all.
public FormPanel(NamedFrame frameTarget)
NamedFrame. The target frame is
not physically attached to the form, and must therefore still be added to a
panel elsewhere.
When the FormPanel targets an external frame in this way, it will not fire the FormSubmitComplete event.
frameTarget - the NamedFrame to be targettedpublic FormPanel(java.lang.String target)
When the FormPanel targets an external frame in this way, it will not fire the FormSubmitComplete event.
target - the name of the <iframe> to receive the results of the
submission, or null to specify that the current page
be replaced| Method Detail |
|---|
public static FormPanel wrap(Element element)
RootPanel.detachNow(Widget).
The specified form element's target attribute will not be set, and the
FormSubmitCompleteEvent will not be fired.
element - the element to be wrapped
public static FormPanel wrap(Element element,
boolean createIFrame)
RootPanel.detachNow(Widget).
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 wrappedcreateIFrame - true to create an <iframe> element
that will be targeted by this form@Deprecated public void addFormHandler(FormHandler handler)
addSubmitCompleteHandler(com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler) and
addSubmitHandler(com.google.gwt.user.client.ui.FormPanel.SubmitHandler) instead
FiresFormEvents
addFormHandler in interface FiresFormEventshandler - the handler interface to addpublic HandlerRegistration addSubmitCompleteHandler(FormPanel.SubmitCompleteHandler handler)
FormPanel.SubmitCompleteEvent handler.
handler - the handler
public HandlerRegistration addSubmitHandler(FormPanel.SubmitHandler handler)
FormPanel.SubmitEvent handler.
handler - the handler
public java.lang.String getAction()
public java.lang.String getEncoding()
ENCODING_MULTIPART or ENCODING_URLENCODED.
public java.lang.String getMethod()
METHOD_GET or METHOD_POST.
public java.lang.String getTarget()
NamedFrame that
will receive the results of submission, or null if none has
been specified.
public boolean onFormSubmit()
onFormSubmit in interface FormPanelImplHostpublic void onFrameLoad()
FormPanelImplHost
onFrameLoad in interface FormPanelImplHost@Deprecated public void removeFormHandler(FormHandler handler)
HandlerRegistration.removeHandler() method on the
object returned by and add*Handler method instead
FiresFormEvents
removeFormHandler in interface FiresFormEventshandler - the handler interface to removepublic void reset()
public void setAction(java.lang.String url)
url - the form's actionpublic void setEncoding(java.lang.String encodingType)
ENCODING_MULTIPART or ENCODING_URLENCODED.
encodingType - the form's encodingpublic void setMethod(java.lang.String method)
METHOD_GET or 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||