use of ui.ex1.entity.Customer in project jmix-docs by jmix-framework.
the class ActionScreen method onCustTableView.
// end::view-after-close-handler[]
// tag::view-action-performed-event[]
@Subscribe("custTable.view")
public void onCustTableView(Action.ActionPerformedEvent event) {
CustomerEdit customerEdit = screenBuilders.editor(custTable).withOpenMode(OpenMode.DIALOG).withScreenClass(CustomerEdit.class).withAfterCloseListener(afterScreenCloseEvent -> {
if (afterScreenCloseEvent.closedWith(StandardOutcome.COMMIT)) {
Customer committedCustomer = (afterScreenCloseEvent.getSource()).getEditedEntity();
System.out.println("Updated " + committedCustomer);
}
}).build();
customerEdit.setReadOnly(true);
customerEdit.show();
}
use of ui.ex1.entity.Customer in project jmix-docs by jmix-framework.
the class ShowScreens method lookupCustomerWithParameter.
// end::lookup-select[]
// tag::lookup-with-parameter[]
private void lookupCustomerWithParameter() {
screenBuilders.lookup(Customer.class, this).withScreenId("uiex1_Customer.browse").withOpenMode(OpenMode.DIALOG).withSelectHandler(users -> {
Customer customer = users.iterator().next();
userField.setValue(customer.getFirstName() + " " + customer.getLastName());
}).build().show();
}
use of ui.ex1.entity.Customer in project jmix-docs by jmix-framework.
the class ShowScreens method lookupCustomer.
// end::create-with-parameter[]
// tag::lookup[]
private void lookupCustomer() {
screenBuilders.lookup(Customer.class, this).withSelectHandler(customers -> {
Customer customer = customers.iterator().next();
userField.setValue(customer.getFirstName() + " " + customer.getLastName());
}).build().show();
}
use of ui.ex1.entity.Customer in project jmix-docs by jmix-framework.
the class UrlRoutesGeneratorScreen method onBtn3Click.
@Subscribe("btn3")
protected void onBtn3Click(Button.ClickEvent event) {
// tag::get-editor-route[]
Customer e = customerField.getValue();
String route = urlRouting.getRouteGenerator().getEditorRoute(e);
// end::get-editor-route[]
notifications.create().withCaption(route).withType(Notifications.NotificationType.TRAY).show();
}
use of ui.ex1.entity.Customer in project jmix-docs by Haulmont.
the class OrderService method createOrderWithCustomer.
// end::load-sorted[]
// tag::save-multiple[]
Order createOrderWithCustomer() {
Customer customer = dataManager.create(Customer.class);
customer.setName("Alice");
Order order = dataManager.create(Order.class);
order.setCustomer(customer);
// <1>
EntitySet savedEntities = dataManager.save(order, customer);
// <2>
return savedEntities.get(order);
}
Aggregations