jmix-projects / jmix-ui

DEPRECATED. Use https://github.com/jmix-framework/jmix
https://www.jmix.io
3 stars 7 forks source link

Add ScreenConfigurer callback to ScreenFacet #662

Closed glebfox closed 3 years ago

glebfox commented 3 years ago

Currently, ScreenFacets have only optionsProvider callback. Since the recommended way of passing parameters to an opened screen is to use public setters of the screen controller, ScreenFacet requires the setScreenConfigurer method.

Solution

the void setScreenConfigurer(Consumer<S> screenConfigurer) method has been added. The preferred way to set the configurer is using a controller method annotated with @Install, e.g:

@Install(to = "test", subject = "screenConfigurer")
private void userBrowseFacetScreenConfigurer(UserBrowse userBrowse) {
    userBrowse.setSomeParam("some value");
}