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();
}
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 DataManagerResourceTest method setUp.
@BeforeEach
void setUp() {
Customer customer = dataManager.create(Customer.class);
customer.setName("test-customer-1");
customer.setConfidentialInfo("111");
authenticator.withSystem(() -> dataManager.save(customer));
customerId = customer.getId();
}
use of datamodel.ex1.entity.Customer in project jmix-docs by Haulmont.
the class TableScreen method onTableSelectEventSelection.
@Subscribe("tableSelectEvent")
public void onTableSelectEventSelection(Table.SelectionEvent<Customer> event) {
Customer customer = tableSelectEvent.getSingleSelected();
notifications.create().withCaption("You selected " + customer.getFirstName() + " " + customer.getLastName() + " customer").show();
}
use of datamodel.ex1.entity.Customer in project jmix-docs by Haulmont.
the class CustomerBrowseData method createCustomer.
// end::find-by-name[]
// tag::create-customer[]
private void createCustomer() {
Customer customer = metadata.create(Customer.class);
customer.setFirstName("John");
customer.setLastName("Doe");
customersDc.getMutableItems().add(customer);
}
Aggregations