Search in sources :

Example 1 with Customer

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

Example 2 with Customer

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

Example 3 with Customer

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

Example 4 with Customer

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();
}
Also used : Order(ui.ex1.entity.Order) RelatedEntitiesBuilder(io.jmix.ui.relatedentities.RelatedEntitiesBuilder)

Example 5 with Customer

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

Aggregations

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