Search in sources :

Example 1 with Customer

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

Example 2 with Customer

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

Example 3 with Customer

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

Example 4 with Customer

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

Example 5 with Customer

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

Aggregations

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