Skip to content

Instantly share code, notes, and snippets.

@amaltson
Created November 6, 2010 19:44
Show Gist options
  • Save amaltson/665656 to your computer and use it in GitHub Desktop.
Save amaltson/665656 to your computer and use it in GitHub Desktop.
Entry point for editing Customers.
public class CustomerDemo implements EntryPoint {
interface Driver extends SimpleBeanEditorDriver<Customer, CustomerEditor> {
}
Driver driver = GWT.create(Driver.class);
public void onModuleLoad() {
CustomerEditor editor = new CustomerEditor();
driver.initialize(editor);
driver.edit(new Customer());
RootPanel.get().add(editor);
Button button = new Button("Get Data");
RootPanel.get().add(button);
button.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent arg0) {
Customer customer = driver.flush();
Window.alert("id: " + customer.getId() + ", first name: "
+ customer.getFirstName() + ", last name: "
+ customer.getLastName());
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment