Home » GWT FormPanel

GWT FormPanel

This Panel deals with the elements of HTML FORM. In this panel, we can add any widget that would be wrapped inside HTML form element.

GWT FormPanel Class Declaration

Let’s see the declaration of com.google.gwt.user.client.ui.FormPanel

GWT FormPanel Nested Classes

Class Description
FormPanel.SubmitCompleteHandler It handles for FormPanel.SubmitCompleteEvent events.
FormPanel.SubmitCompleteEvent It is fired when a form has been submitted successfully.
FormPanel.SubmitEvent It is fired when the form is submitte
FormPanel.SubmitHandler It handles for FormPanel.SubmitEvent events.

GWT FormPanel Constructors

Constructor Description
FormPanel() It creates a new FormPanel.
FormPanel(Element element) It is used by subclasses to explicitly use an existing element.
FormPanel(Element element, boolean createIFrame) It is used by subclasses to explicitly use an existing element.
FormPanel(NamedFrame frameTarget) It creates a FormPanel that targets a NamedFrame.
FormPanel(NamedFrame frameTarget) It creates a FormPanel that targets a NamedFrame.
FormPanel(java.lang.String target) It creates a new FormPanel that targets string as input.

GWT FormPanel Methods

Modifier and Types Method Description
void addFormHandler(FormHandler handler) It adds a form widget to the panel.
java.lang.String getAction() It gets the ‘action’ associated with this form.
java.lang.String getEncoding() It gets the encoding used for submitting this form.
java.lang.String getMethod() It gets the HTTP method used for submitting this form.
java.lang.String getTarget() It gets the form’s ‘target’.
protected void onAttach() This method is called when a widget is attached to the browser’s document.
protected void onDetach() This method is called when a widget is detached from the browser’s document.
void onFrameLoad() It is called when the target frame is done loading.
void setAction(SafeUri url) It sets the ‘action’ associated with this form.
void setAction(java.lang.String url) It sets the ‘action’ associated with this form.
void setEncoding(java.lang.String encodingType) It sets the encoding used for submitting this form.
void submit() It submits the form.
static FormPanel wrap(Element element) It creates a FormPanel that wraps an existing
element.
static FormPanel wrap(Element element, boolean createIFrame) It creates a FormPanel that wraps an existing
element.

GWT FormPanel Example

//SampleFormPanel.java:

//SampleFormPanel.css:

Output:

GWT Form Panel

Next TopicGWT Scroll Panel

You may also like