Skip to content

Entity Inspector loses unsaved changes of a composition child when its edit dialog is reopened #5653

Description

@knstvk

Environment

Jmix version: 2.8.3

Description

In Entity Inspector, a @Composition collection item edited in the nested dialog loses its unsaved value when the same item is opened for editing again while the master entity has not been saved yet.

The item's edit dialog shows the value stored in the database instead of the current in-memory value, so the dialog disagrees with the collection grid behind it. Clicking OK in that dialog writes the database value back and silently discards the edit.

Detail views generated for the same entities behave correctly, so the problem is specific to Entity Inspector.

Steps to reproduce

Model: Order with a @Composition orderLines collection; OrderLine has a quantity attribute. An Order with a line whose quantity is 15 exists in the database.

  1. Open the order in Entity Inspector (Data Tools → Entity Inspector → Order, then edit the order).
  2. On the Order lines tab, select the line and click Edit.
  3. Set Quantity to 10 and click OK. The order lines grid shows 10. Do not save the order.
  4. Select the same line again and click Edit.

Actual behavior

The Quantity field shows 15, the value from the database.

Clicking OK in this dialog merges 15 back into the order's data context, so the edit made in step 3 is lost — the grid shows 15 again and saving the order does not store 10.

Expected behavior

The reopened dialog shows 10, the current unsaved value from the order's data context, as it does when editing the same aggregate through dedicated Order and OrderLine detail views.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions