Different Screens for one Entity from Menu

Hi,
I am trying to create different Screens for one Entity.
The Entity is e.g. “app_prefrences”
So I built an edit-screen “app_preferences.edit” All works fine, I call it from menu
<item screen="app_preferences.edit" icon="font-icon:WRENCH" caption="msg://...app.pfrefs"/>

Now I do want lots of small screens for this. Like
“app_preferences_property1.edit”, “app_preferences_property2.edit”
But when I add it to the menu like:
<item screen="app_preferences_property1.edit" icon="font-icon:WRENCH" caption="msg://...app.pfrefsprop1"/>

I get
IllegalArgumentException: MetaClass not found for app_preferencesprop1
if I now change the menu and add a class like this:

<item screen="app_preferences_property1.edit" class="......app_preferences" icon="font-icon:WRENCH" caption="msg://...app.pfrefsprop1"/>

I get
IllegalStateException: MenuItem can’t have more than one action.

Whats the correct way, to open more than one screen for the same entity?
Thx

Try using id.

<item screen="app_preferences_property1.edit" id="app_preferences_property1" class="......app_preferences" icon="font-icon:WRENCH" caption="msg://...app.pfrefsprop1"/>

Then, to make the menu element unique, not the screen class, but the id will be used.

Thx, but that is not the solution.
Still
IllegalArgumentException: MetaClass not found for app_preferences_property1

Seems as long as I dont name the Screen exactly like the Entity, it is not working.
Any other suggestions?

As you can see in the error message, you continue to refer to the ‘app_preferences_property1’ class in the menu item, which does not exist.
The ‘class’ attribute is optional.
When the user clicks on the menu item, the corresponding screen will be opened on the main screen.
MenuConfig :: Jmix Documentation

It is important to specify ‘screen’ (from annotation UiController) and ‘id’ (for a menu item) if the same screen is called from different menu items.

See my example.
There is one entity and two different screen classes with different screen IDs in ‘UiController’. The name of the identifier, of course, is not the same as the name of the entity and the name of the screen class.
jmixmenu.zip (93.7 KB)

My solution for this is now
<item id="app_preferences_property2" bean="menuScreenBean" beanMethod="app_preferences_property2_openhelper"..

But now I cant seem to enable it within the rules, because its not a screen anymore, but a bean.
How can I enable this with my roles?

   @MenuPolicy(menuIds = {"app_preferences_property1.edit", *"app_preferences_property2*"})
    @ScreenPolicy(screenIds = {"app_preferences_property1.edit", app_preferences_property2.edit"})
    void screens();

Error: The “Screen” does not exist - which is true for the menu, but the screen as such of course exists.

(But I will check your example and get back to you, thx)

I have added the problem to your solution ;), please try it
Thank you
jmixmenuEditor.zip (381.5 KB)

Found the simple solution to the problem. Don’t know why I didn’t come up with it earlier. Wrong focus, I guess…

With the Browse/Lookup it does not matter, but with the Editor the Name of the Uicontroller used must be the name of the entity, followed by a dot and whatever you want to name the screen

screen="app_preferences.editProperty1"

this will work

jmixmenuEditor.zip (357.7 KB)

Thx for taking the time

I wonder why tho. The Controller does specify the Metaclass
extends StandardEditor<Preferences>
and should be able to open the screen with the needed Entity. The framework should not use the name of the UiController to generate its entity.

Regards