How to implement one UI controller with multiple UI descriptor

Hi,
In cuba6, we implemented below behavior:
For one AbstractEditor, we created multiple (hundreds of) xml screen descriptor for it, which share same DB entity, same AbstractEditor class. We define differerent screen id for different xml screen descriptor.
For example:
screen1 -> screen1.xml, use menu item screen1.
screen2 -> screen2.xml, use menu item screen2.
Both sreen1.xml and screen2.xml use same AbstractEditor class.

Now we considerring use the new screen API in cuba7, any suggestions? How to make differnt UIDescriptor use same UIController class? I mean how to define the screen annotations:

@UiController("demo_FooScreen")
@UiDescriptor("foo-screen.xml")

Or how to implement a way having one UIController but different screen descriptor?
I considered ScreenFragment, use ScreenFragment to implement the difference of screen1 and screen2, but that means I need to inject hunderds of ScreenFragment in the UIContoller.

or is there a way to programly set the screen xml file?

Hello @anjingjing

It’s not possible to implement such behavior with CUBA 7 API due to changed behavior of screen loading. So I can only suggest you to extract some generic logic into base class and reuse it.

Regards,
Daniil

Got you. Thanks Daniil.