use of datamodel.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 datamodel.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 datamodel.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);
}
use of datamodel.ex1.entity.Customer in project jmix-docs by Haulmont.
the class CustomerBrowse method onGetLinkButtonClick.
// end::related-action-performed-event[]
// tag::get-editor-route[]
@Subscribe("getLinkButton")
protected void onGetLinkButtonClick(Button.ClickEvent event) {
Customer selectedCustomer = customersTable.getSingleSelected();
if (selectedCustomer != null) {
String routeToSelectedRole = urlRouting.getRouteGenerator().getEditorRoute(selectedCustomer);
dialogs.createMessageDialog().withCaption("Generated route").withMessage(routeToSelectedRole).withWidth("710").show();
}
}
use of datamodel.ex1.entity.Customer in project jmix-docs by Haulmont.
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();
}
Aggregations