Generalize composite browser/edit screen code through a delegate (gist attached)

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.

Gist link: CUBA framework: CompositeLookupDelegate class and associated Builder to eliminate boilerplate code for composite screens · GitHub

Thanks,
Paolo

Hi Paolo,

Thank you for the contribution. We’ll consider including it to the platform in one of the next releases.

Thanks for feedback Konstantin.

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.

Bye
Paolo

:ticket: See the following issue in our bug tracker:

https://youtrack.cuba-platform.com/issue/PL-9331