Package org.jboss.errai.demo.grocery.client.shared

Examples of org.jboss.errai.demo.grocery.client.shared.Item


    // TODO (after ERRAI-366): make this method package-private
    @EventHandler("saveButton")
    public void onSaveButtonClicked(ClickEvent event) {
        Department resolvedDepartment = Department.resolve(em, department.getText());
        Item item = itemBinder.getModel();
        item.setDepartment(resolvedDepartment);
        item.setAddedBy(user);
        item.setAddedOn(new Date());

        final Set<ConstraintViolation<Item>> violations = validator.validate(item);
        if (violations.size() > 0) {
          ConstraintViolation<Item> violation = violations.iterator().next();
          overallErrorMessage.setText(violation.getPropertyPath() + " " + violation.getMessage());
View Full Code Here


        // clear the item form after an item is saved
        newItemForm.setAfterSaveAction(new Runnable() {
            @Override
            public void run() {
                newItemForm.setItem(new Item());
            }
        });
    }
View Full Code Here

  private void initInstance() {
    refreshFromDb();
    newItemForm.setAfterSaveAction(new Runnable() {
      @Override
      public void run() {
        newItemForm.setItem(new Item());
      }
    });
  }
View Full Code Here

  }

  @EventHandler("saveButton")
  void onSaveButtonClicked(ClickEvent event) {
    Department resolvedDepartment = Department.resolve(em, department.getText());
    Item item = itemBinder.getModel();
    item.setDepartment(resolvedDepartment);
    item.setAddedBy(user);
    item.setAddedOn(new Date());

    groceryList.getItems().add(item);
    em.persist(groceryList);
    em.flush();
View Full Code Here

    // clear the item form after an item is saved
    newItemForm.setAfterSaveAction(new Runnable() {
      @Override
      public void run() {
        newItemForm.setItem(new Item());
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.jboss.errai.demo.grocery.client.shared.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.