Skip to content

The instance container loader delegate is not called in the standard view #4908

@kxb-pro

Description

@kxb-pro

Environment

Jmix version: 2.x

Bug Description

The delegate is not invoked in the instance container loader in the Standard view.

Steps To Reproduce

  1. Create a standard view.
  2. Add the Instance container to the Standard view descriptor in the loader without specifying a query string.
  3. Add a Form layout to the Standard view to display values ​​from the instance container.
  4. In the Standard view controller, add a delegate call to set the entity instance to the instance container.
  5. Run the application.
  6. Open the created standard view.
  7. The fields form layout will remain empty.

Current Behavior

In the needLoad() method, io.jmix.flowui.model.impl.InstanceLoaderImpl only checks for the presence of an entityId or queryString and does not check for the presence of a delegate to obtain an entity instance to install into the container. As a result, the installed delegate is not invoked when the Standard view is opened.
To work around this, you can specify a querystring in the instance container loader. However, when using a delegate, this is likely not necessary.
In JMix 1.x, obtaining an entity instance via a delegate in the standard view worked without issue. The needLoad() method was called after checking for the presence of the delegate.

Expected Behavior

When a delegate is set, the entity instance must be set to the instance container in the standard view, regardless of entityId or query.
This is how it was done in JMix 1.x.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions