use of ui.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 ui.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 ui.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 ui.ex1.entity.Customer in project jmix-docs by Haulmont.
the class RelatedEntitiesScreen method onRelatedClick.
// tag::related-click[]
@Subscribe("related")
protected void onRelatedClick(Button.ClickEvent event) {
RelatedEntitiesBuilder builder = relatedEntitiesSupport.builder(this);
Screen customerBrowser = builder.withEntityClass(Order.class).withProperty("customer").withSelectedEntities(ordersTable.getSelected()).build();
customerBrowser.show();
}
use of ui.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();
}
Aggregations