Edited entity is not saved when only referenced fields are updated

I have migrated an application from Cuba 7.2 to Jmix 1.1.0. I can create entities but cannot edit them if only referenced fields are updated. Appears to be related to this topic but my referenced fields are not transient. Yesterday updated to Jmix 1.1.1 but still facing this issue.

So when you select another reference instance in the editor screen, changes are not saved?
If so, it looks like an enhancing issue.
To find out whether the entity class is enhanced, find it in the build/classes/java/main directory and open in the IDE. The decompiled class should have a lot of interfaces and setters should have an invokation like EntityInternals.fireListeners(this, "name", __prev, __new);

I got stuck in some other work and couldn’t check this. Just verified, interfaces and this invocation are there in decompiled class. Two fields in my class are of same type, can this be issue?

I have also checked from Entity inspector, the fields are not visible in Entity Inspector browse view but are correctly set in Entity Inspector edit mode.

I removed these referenced fields from Browse Collection and Edit Instance fetch plans and it’s working fine. Both of them extend _base. Am I missing something? I have another referenced field in same screen and that’s working fine.

Now I am in trouble, in another screen I need to fetch additional attributes, field is not shown if I put referenced variable in fetchPlan and I get unFetched attribute error if I don’t put it. Someone please help.

Hi Shahzad

Have you checked your entity-edit screens for the dataLoadCoordinator reference in the facet?


    <dataLoadCoordinator auto="true"/>

Please see: DataLoadCoordinator :: Jmix Documentation

I had the situation that one of my screens did not have this dataLoadCoordinator setting in the facet and I could access all of the entity attributes but in all of my other edit-screens nothing was loaded; the entity was always null. Maybe your problem lies somewhere inbetween the behavior that I had. (I intend to report this situation as a migration finding but haven’t yet had the time to do so.)

I hope that this might help.

Best regards

Thanks for the response Chris

I have this attribute in my browse and edit screen facets

    <dataLoadCoordinator auto="true"/>
    <screenSettings id="settingsFacet" auto="true"/>

My project is not migrated one. I had a few screens developed in CubaPlatform so I decided to make a fresh Jmix platform project.

Hi Shahzad,

Could you reproduce the problem on a small test project?
If not, please attach the entity and screen code.