12.7. Using FormPanel

The FormPanel is GWT’s own take on the HTML form. It’s a subclass of SimplePanel, which means you can place only one widget inside the FormPanel. Typically this would be a VerticalPanel, a Grid, or some other widget where you can lay out the individual form elements.

The form elements consist of any widget that’s rendered as a standard HTML form element. At the time of this writing this includes the widgets CheckBox, RadioButton, FileUpload, Hidden, ListBox, SimpleCheckBox, SimpleRadioButton, TextArea, TextBox, and PasswordTextBox. All of these widgets, including the FormPanel, are in the package com.google.gwt.user.client.ui.

Using FormPanel is like using a regular HTML form in all but one respect, and that’s that the ...

Get GWT in Action, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.