Hi
I was tired of the boilerplate code that is generated for each composite lookup/edit screen by CUBA studio, so I wrote a simple delegate class that generalizes that code.
I suggest implementing the same or similar solution in next CUBA version, to keep the controller smaller and free of repetitive code.
Meanwhile, I updated the gist adding support for not auto commit screens (reloading on item change occurs only if the entity is not new/modified), and adding an
AfterInitEditComponents
handler to handle custom UI modifications after the edit state changes.