We are using JMIX version 1.6. We have an entity ActivityGroup and within it composition entities Activity. In Edit screen of ActivityGroup, we are changing serial number of activities programmatically by pressing up & down buttons. But , they are not reflected in edit screen of Activity Entity. The changes are only reflected on using datamanager.save() or datacontext.commit() functions. What need to be done to access the edited Activity fields in edit screen of any other activity. The code being used is as follows:
Thanks Dmitriy. A few of the issues are cleared while preparing the test project. The remaining issue we are facing that when we edit one of the composition entity and without saving parent entity we edit another composition entity we are unable to access the details of last edited composition entity. To make the issue clear, we have created a test project and the issue is marked as TODO in code. Please guide. untitled.zip (2.0 MB)
Hi,
I’m not sure if I faced the same problem. I also had a composition with a datagrid in the detailView of the main entity. After I tried to create a new object there, it also appeared in the dataGrid. If I then wanted to edit it, a window opened which displayed the details of the entity, but jmix wanted to create a new entity with these details. So I always had an SQL error because of the unique PK.
I was able to work around this by adding entityStates.setNew(myNewEntity, false);
in the afterCloseListener of the create action.
Thanks Stefanie. But i have changed to structure of entire application changing all the composition entities with entities with association to parent entity which is mandatory. Please treat the issue closed.
Thanks.