Initializer and AfterCloselistener do not get called

I have a Datagrid in which has the standard action

<action id="create" type="list_create" />

and a button that calls it above:

<button id="createBtn" action="someDataGrid.create" />

the automatically created initializer does not get called:

@Install(to = "someDataGrid.create", subject = "initializer")
    private void someDataGridCreateInitializer(final someEntity entity) {
        initService(entity)
    }

What can be done? I do not want to initialize in the detail view, because that gets called also when I open a view with a newly created copy of an entity. Another irritating thing that seems new to me, as I think in previous versions, if editEntity(entity) was called, the initEnitity Listener would not be called in the then so called edit screens.

Thanks

Hi!

If we refer to the Java documentation of this method, you can see that such an implementation is only possible when using the DIALOG opening mode:
image

This can be configured using the Component Inspector
image

You can use viewConfigurer instead.

Best regards,
Dmitriy

Ah, Thank you.
But it feels that one cannot handle it the same way.

Sadly the viewConfigurer does not get called either.

I think there was miscommunication.
In my answer I only mentioned the configuration methods for opening in dialog mode. viewConfigurer is also available only for dialogMode.

If you want to pass parameters into the view using navigation, you can use two configurators:

  • queryParametersProvider
  • routeParametersProvider

You can also programmatically get an instance of the open view (but only after the navigation process is complete). ViewNavigators bean is used for it:

            viewNavigators.view(SomeView.class)
                    .withBackwardNavigation(true)
                    .withAfterNavigationHandler(event -> event.getView().configureView()
                    .navigate();

Best regards,
Dmitriy

Indeed. Thanks for the clarification.