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.
- Open the order in Entity Inspector (Data Tools → Entity Inspector → Order, then edit the order).
- On the Order lines tab, select the line and click Edit.
- Set Quantity to 10 and click OK. The order lines grid shows 10. Do not save the order.
- 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.
Environment
Jmix version: 2.8.3
Description
In Entity Inspector, a
@Compositioncollection 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:
Orderwith a@CompositionorderLinescollection;OrderLinehas aquantityattribute. AnOrderwith a line whosequantityis 15 exists in the database.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
OrderandOrderLinedetail views.