Guest User

Untitled

a guest
Jun 20th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public class CustomerDemo implements EntryPoint {
  2.  
  3. interface Driver extends SimpleBeanEditorDriver<Customer, CustomerEditor> {
  4. }
  5.  
  6. Driver driver = GWT.create(Driver.class);
  7.  
  8. public void onModuleLoad() {
  9. CustomerEditor editor = new CustomerEditor();
  10. driver.initialize(editor);
  11. driver.edit(new Customer());
  12.  
  13. RootPanel.get().add(editor);
  14.  
  15. Button button = new Button("Get Data");
  16. RootPanel.get().add(button);
  17.  
  18. button.addClickHandler(new ClickHandler() {
  19.  
  20. public void onClick(ClickEvent arg0) {
  21. Customer customer = driver.flush();
  22. Window.alert("id: " + customer.getId() + ", first name: "
  23. + customer.getFirstName() + ", last name: "
  24. + customer.getLastName());
  25. }
  26. });
  27. }
  28. }
Add Comment
Please, Sign In to add comment