Search in sources :

Example 1 with CustomerEdit

use of ui.ex1.screen.entity.customer.CustomerEdit in project jmix-docs by Haulmont.

the class ActionScreen method onCustTableView.

// end::view-after-close-handler[]
// tag::view-action-performed-event[]
@Subscribe("custTable.view")
public void onCustTableView(Action.ActionPerformedEvent event) {
    CustomerEdit customerEdit = screenBuilders.editor(custTable).withOpenMode(OpenMode.DIALOG).withScreenClass(CustomerEdit.class).withAfterCloseListener(afterScreenCloseEvent -> {
        if (afterScreenCloseEvent.closedWith(StandardOutcome.COMMIT)) {
            Customer committedCustomer = (afterScreenCloseEvent.getSource()).getEditedEntity();
            System.out.println("Updated " + committedCustomer);
        }
    }).build();
    customerEdit.setReadOnly(true);
    customerEdit.show();
}
Also used : CollectionLoader(io.jmix.ui.model.CollectionLoader) java.util(java.util) Customer(ui.ex1.entity.Customer) BulkEditors(io.jmix.ui.bulk.BulkEditors) Dialogs(io.jmix.ui.Dialogs) io.jmix.ui.action.list(io.jmix.ui.action.list) TagLookupAction(io.jmix.ui.action.tagpicker.TagLookupAction) Autowired(org.springframework.beans.factory.annotation.Autowired) Metadata(io.jmix.core.Metadata) ParamsMap(io.jmix.core.common.util.ParamsMap) CustomerEdit(ui.ex1.screen.entity.customer.CustomerEdit) ColumnsMode(io.jmix.ui.app.bulk.ColumnsMode) Notifications(io.jmix.ui.Notifications) io.jmix.ui.screen(io.jmix.ui.screen) ScreenBuilders(io.jmix.ui.ScreenBuilders) CustomerBrowse(ui.ex1.screen.entity.customer.CustomerBrowse) RemoveOperation(io.jmix.ui.RemoveOperation) Action(io.jmix.ui.action.Action) BaseAction(io.jmix.ui.action.BaseAction) Named(javax.inject.Named) MetaProperty(io.jmix.core.metamodel.model.MetaProperty) DialogAction(io.jmix.ui.action.DialogAction) io.jmix.ui.component(io.jmix.ui.component) Customer(ui.ex1.entity.Customer) CustomerEdit(ui.ex1.screen.entity.customer.CustomerEdit)

Aggregations

Metadata (io.jmix.core.Metadata)1 ParamsMap (io.jmix.core.common.util.ParamsMap)1 MetaProperty (io.jmix.core.metamodel.model.MetaProperty)1 Dialogs (io.jmix.ui.Dialogs)1 Notifications (io.jmix.ui.Notifications)1 RemoveOperation (io.jmix.ui.RemoveOperation)1 ScreenBuilders (io.jmix.ui.ScreenBuilders)1 Action (io.jmix.ui.action.Action)1 BaseAction (io.jmix.ui.action.BaseAction)1 DialogAction (io.jmix.ui.action.DialogAction)1 io.jmix.ui.action.list (io.jmix.ui.action.list)1 TagLookupAction (io.jmix.ui.action.tagpicker.TagLookupAction)1 ColumnsMode (io.jmix.ui.app.bulk.ColumnsMode)1 BulkEditors (io.jmix.ui.bulk.BulkEditors)1 io.jmix.ui.component (io.jmix.ui.component)1 CollectionLoader (io.jmix.ui.model.CollectionLoader)1 io.jmix.ui.screen (io.jmix.ui.screen)1 java.util (java.util)1 Named (javax.inject.Named)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1