Is there a method to update an instance associated with a form through a datasource?

Good morning.

I have the screen below, which has a list of items from entity DOCITEM which has compositions to other entities (DOCTEXTITEM, TASKDEFINITION). The screen is similar to a Master Detail screen but the linked entity on the right is updated through a screen fragment containing a form that is dependent on what type of entity is being edited in that area (I programmatically create the appropriate screen fragment to edit the linked instance).
The problem is that the linked entity instance is not being automatically updated when the user fills the fields and when the user clicks on another item on the left list, the current screen fragment is replaced, destroying its contents.
My question is: Is there a recommended method to update the current instance associated with the form? The obvious solution is to move each field to the instance returned by .getItem() but this seems to be too crude a solution.
I hope I was able to state the problem clearly.

image

Perhaps your form should be linked to the nested data containers defined for DOCTEXTITEM, TASKDEFINITION entities. Then it will be updated automatically when the master entity and its related entities are changed in their containers while you navigate through the list.

Ok, thanks, Konstantin.