LookupScreenFacet

LookupScreenFacet is essentially a ScreenFacet with an extended set of options for opening entity lookup screens.

Component’s XML-name: lookupScreen.

Attributes

In addition to the attributes of ScreenFacet, LookupScreenFacet has the following attributes of EditorScreenFacet:

Events and Handlers

To generate a handler stub in Jmix Studio, select the facet in the screen descriptor XML or in the Jmix UI hierarchy panel and use the Handlers tab of the Jmix UI inspector panel.

Alternatively, you can use the Generate Handler button in the top panel of the screen controller.

AfterCloseEvent

AfterCloseEvent is sent after the screen configured by the facet is closed. See AfterCloseEvent for details.

AfterShowEvent

AfterShowEvent is sent after the screen configured by the facet is shown. See AfterShowEvent for details.

OptionsProvider

ScreenConfigurer

SelectHandler

The SelectHandler delegate method allows you to get the collection of selected entities from the lookup screen. In the example below, the lookup screen of the Customer entity is opened on button clicks, and the email of the selected customer is written to the textField:

<facets>
    <lookupScreen id="lookupScreen"
                  entityClass="ui.ex1.entity.Customer"
                  openMode="DIALOG"
                  screenClass="ui.ex1.screen.entity.customer.CustomerBrowse"
                  onButton="btn">
    </lookupScreen>
</facets>
<layout>
    <textField id="userField"/>
    <button caption="Button"
            id="btn"/>
</layout>
@Autowired
private TextField<String> userField;

@Install(to = "lookupScreen", subject = "selectHandler")
private void lookupScreenSelectHandler(Collection<Customer> collection) {
    if (!collection.isEmpty()) {
        userField.setValue(collection.iterator().next().getEmail());
    }
}

To register the event handler programmatically, use the setSelectHandler() method.

SelectValidator

It is a handler that is invoked when the user clicks Select in the lookup screen. See SelectValidator for details.

To register the event handler programmatically, use the setSelectValidator() method.

Transformation

It is a handler that is invoked after entities are selected and validated in the lookup screen. See Transformation for details.

To register the event handler programmatically, use the setTransformation() method.

All XML Attributes

You can view and edit attributes applicable to the facet using the Jmix UI inspector panel of the Studio’s Screen Designer.