Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jboss.errai.demo.grocery.client.local;
 
 
A form for editing the properties of a new or existing Store object.

Author(s):
Jonathan Fuerth <jfuerth@gmail.com>
public class StoreForm extends Composite {
  @Inject private EntityManager em;
  // injecting this data binder causes automatic binding between
  // the properties of Store and the like-named @DataField members in this class
  // Example: property "store.name" tracks the value in the TextBox "name"
  @Inject @Bound @DataField private TextBox name;
  @Inject @DataField private Button saveButton;
  private Runnable afterSaveAction;

  
Returns the store instance that is permanently associated with this form. The returned instance is bound to this store's fields: updates to the form fields will cause matching updates in the returned object's state, and vice-versa.

Returns:
the Store instance that is bound to the fields of this form.
  public Store getStore() {
    return .getModel();
  }
  // TODO (after ERRAI-366): make this method package-private
  @EventHandler("saveButton")
  public void onSaveButtonClicked(ClickEvent event) {
    .flush();
    if ( != null) {
      .run();
    }
    ..println("Click handler finished for " + .getModel());
  }
  void cleanup() {
  }
  public void setAfterSaveAction(Runnable afterSaveAction) {
    this. = afterSaveAction;
  }
New to GrepCode? Check out our FAQ X