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:
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)
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
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.