Skip to content

Composition child edit dialog reloads from DB on open, showing a stale value that disagrees with the grid #5657

Description

@mig-sam

Environment

Jmix version: 3.0
Jmix Studio Plugin Version: 3.1.SNAPSHOT8083-262
IntelliJ version: IntelliJ IDEA 2026.2.1 RC

Bug Description

When a @Composition child is modified in memory but not yet saved (e.g. by an ItemPropertyChangeEvent listener that resets a sibling), reopening that child in its edit dialog shows the stale database value, not the current in-memory value. The parent grid (bound to the in-memory collection container) and the child edit dialog therefore disagree. It specifically affects listener-modified siblings, not the line you edit directly: a child you edit yourself reopens with its in-memory (unsaved) value, whereas a sibling changed only by the listener reopens with the stale DB value. So the reload does not honor the parent context's dirty state for the listener-injected edit.

Steps To Reproduce

1.Launch demo project
2.Check that Order6DetailView.java has next listner:

    public void onLines6DcItemPropertyChange(final InstanceContainer.ItemPropertyChangeEvent<Line6> event) {
        if ("primary".equals(event.getProperty()) && Boolean.TRUE.equals(event.getValue())) {
            Line6 changed = event.getItem();
            for (Line6 line : lines6Dc.getItems()) {
                if (line != changed && Boolean.TRUE.equals(line.getPrimary())) {
                    line.setPrimary(false);
                }
            }
        }
    }

3.Navigate to Order6s view. Open ORD-1 for edit. Baseline: Line A = primary (true), Line B/C = false
4.Open Line B in the dialog → check PrimaryOK. The listener resets Line A to false.
5.The grid now shows Line A = False (correct in-memory value)
6.Open Line A in the edit dialog

Current Behavior

The Primary checkbox is checked (true) — the stale DB value.

Expected Behavior

The Primary checkbox is unchecked (false), matching the grid

Sample Project

Image

DataContext31sn_0901.zip

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