I have an edit screen for my Entity HrUser. This Entity has related Entities of type ServiceRequest.
When I open my screen I have 3 Tabs:
HrUser object details
ServiceRequest list,where I can create, modify and delete related Service Requests
History: Where I see all changes made in HrUser objects as well as in related ServiceRequest objects
Since the query to get the history can be quite complex I load the history in my onAfteShow event
String query = hrUserService.getEntityLogQuery(getEditedEntity());
entityLogDl.setQuery(query);
entityLogDl.load();
// Query can be like this:
// select el from sec$EntityLog el where el.entity = 'userlifecyclemgmt_HrUser' and el.entityRef.entityId = '81b81444-0444-4ff0-c409-64393be41140' or el.entity = 'userlifecyclemgmt_ServiceRequest' and el.entityRef.entityId = '7b8c27c1-41e8-53f3-d94c-c15b865c4bfa'
That works fine, but the last line loading the collection causes the screen to ask to save changes, when I use the cancel button instead of just closing.
When commenting the line out, the screen just closes.
Question now would be: How can I tell my screen to ignore the changes in that collection
<collection id="entityLogDc" view="entityLogItem-view" class="com.haulmont.cuba.security.entity.EntityLogItem">
<loader id="entityLogDl">
<query>
<![CDATA[select l from sec$EntityLog l where l.entityInstanceName = 'fake name']]>
</query>
</loader>
<collection id="entityLogAttributes" property="attributes"/>
</collection>