MyEclipse for Spring
Code Reference: CustomerEditWidget.java
The GWT widget that renders the customer form. This page covers the widget structure, bindings and the events it raises.
CustomerEditWidget is the GWT view for the customer form. It builds the input fields, binds them to the editor and raises events when the user acts. The widget contains no business rules and no service calls.
Structure
- Fields. A name box, an email box and a status list.
- Actions. Save and cancel buttons.
- Messages. An area for validation and success messages.
- Binding. A small adapter between the editor state and the widget fields.
Events
The widget raises a save event with the current values and a cancel event with no payload. The presenter listens for both and decides what to do. That split keeps the widget reusable and makes it testable without a browser.
The widget is generated. To add a field, add it to the model and regenerate both the widget and its ui.xml file. Hand written widgets can be kept in a separate package and are not overwritten.