Search in sources :

Example 1 with Customer

use of dataaccess.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();
}
Also used : Customer(ui.ex1.entity.Customer)

Example 2 with Customer

use of dataaccess.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();
    }
}
Also used : Customer(ui.ex1.entity.Customer)

Example 3 with Customer

use of dataaccess.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();
}
Also used : Customer(security.ex1.entity.Customer) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 4 with Customer

use of dataaccess.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();
}
Also used : Customer(ui.ex1.entity.Customer)

Example 5 with Customer

use of dataaccess.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);
}
Also used : Customer(ui.ex1.entity.Customer)

Aggregations

Customer (ui.ex1.entity.Customer)17 Customer (dataaccess.ex1.entity.Customer)12 BeforeEach (org.junit.jupiter.api.BeforeEach)5 Test (org.junit.jupiter.api.Test)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 CustomerEdit (ui.ex1.screen.entity.customer.CustomerEdit)5 Action (io.jmix.ui.action.Action)4 BaseAction (io.jmix.ui.action.BaseAction)4 io.jmix.ui.screen (io.jmix.ui.screen)4 Named (javax.inject.Named)4 Order (dataaccess.ex1.entity.Order)3 Metadata (io.jmix.core.Metadata)3 ParamsMap (io.jmix.core.common.util.ParamsMap)3 Notifications (io.jmix.ui.Notifications)3 ScreenBuilders (io.jmix.ui.ScreenBuilders)3 DialogAction (io.jmix.ui.action.DialogAction)3 io.jmix.ui.component (io.jmix.ui.component)3 BigDecimal (java.math.BigDecimal)3 TransactionalEventListener (org.springframework.transaction.event.TransactionalEventListener)3