Cuba 7: Passing Parameters to From Browser- to Edit-Screen

in Cuba 6 there was a way to pass a parameter-Map from a browse- to an edit-screen.


private CreateAction positionTableCreate;

public void init(Map<String, Object> params) {

    HashMap<String,Object> hm4PosWindows = new HashMap<>();


In Cuba 7 it is possible, to inject the CreateAction in the browsing-Controller, but what is the way to pass a parameter to the called StandardEditor ?

In the manual of Cuba 7 found an hint for passing paramters for programmatic created screens Using Screen Parameters in Loaders
But what is the way, when the EditAction/CreateAction … are used ?


Found a way:

onCreateBtnClick(Button.ClickEvent event)
and iterated the open screens like

for (Screen s: screens.getOpenedScreens().getActiveScreens()) {

After found the EditScreen i used a simple setter-Method to pass the parameters.

It seems more easy than the old way …

Hi Martin,

Please don’t do this:

for (Screen s: screens.getOpenedScreens().getActiveScreens()) {

In CUBA 7, the standard actions are thin wrappers around screen builders. So instead of injecting/overriding/parameterizing standard actions, just create a custom handler and use the ScreenBuilders API as described in the documentation, for example:

protected void onCustomersTableCreateActionPerformed(Action.ActionPerformedEvent event) {
    CustomerEdit editScreen = screenBuilders.editor(customersTable)
1 Like

Hi Konstantin,

ok. Now I understand it. It works.


how did you finally passed the parameters? there’s no such method in editScreen as setWindowParams

When you create the CustomerEdit class, you add setters and getters for the parameters you wish to pass into the screen. In the example above, the class will have getters and setters for the someParameter field:

class CustomerEdit extends StandardEditor<Customer> {

    private String someParameter;

    public void setSomeParameter(String param) {

        this.someParameter = param

    public String getSomeParameter() {

        return someParameter;

If you look at the example, you call edit.setSomeParameter(…) just before you call which will set the parameter in your screen before it appears.

More details here:


Is it possible to pass parameters from a 7.x controller StandardEditor to an old 6.x AbstractEditor?
I need to pass parameters to the 6.x collectionDatasource editor screen

Yes, you can do it using MapScreenOptions, for example:

screenBuilders.editor(Foo.class, this)
        .withOptions(new MapScreenOptions(ParamsMap.of("paramName", paramValue)))
1 Like