I’m using TreeDataGrid in many places of my application. But the create actions doesn’t work properly for TreeDataGrid. When user selects a record and tries to create a child record of that record using the Create action, it doesn’t work creates the parent child relationship instead it creates as if a new record.
I found below code in Create Action which is responsible for set the parent/child relationship but the if condition is failing while checking whether the TreeDataGrid is instance of Tree.
The code that you’re pointing is in the legacy CreateAction (com.haulmont.cuba.gui.components.actions.CreateAction) that is used in legacy screen, i.e. CUBA 6 screens. Since you’re using CUBA 7, the preferable way is using CreateInitializer as shown by @harikrishnadhas.k1. Even though it requires additional code from a developer, this approach is more flexible. In case, you need such functionality in several screens, I’d recommend implementing a custom action that sets a parent if possible.