Hello,
I’ve added a UserSettings entity and a UserSettingsEdit editor screen and I’m opening it from the menu via bean as a place where each user of this app can save their individual settings. Everything works great, but I noticed that if there’s a tab open in the app, the UserSettingsEdit screen opens in the existing tab:
My bean method looks like this:
public void openUserSettingsForCurrentUser() {
UserSettings userSettings = getUserSettingsForCurrentUser();
FrameOwner frameOwner = AppUI.getCurrent().getTopLevelWindowNN().getFrameOwner();
screenBuilders.editor(UserSettings.class, frameOwner)
.editEntity(userSettings)
.withScreenClass(UserSettingsEdit.class)
.build()
.show();
}
private UserSettings getUserSettingsForCurrentUser() {
return dataManager.load(UserSettings.class)
.query("select e from UserSettings e where e.user = :currentUser")
.parameter("currentUser", currentUserSubstitution.getEffectiveUser())
.one();
}
I can only guess that the frameOwner
portion of this screenBuilders
statement is causing the scenario - i.e. - AppUI.getCurrent().getTopLevelWindowNN().getFrameOwner()
. I’ve checked the documentation in Opening Screens, Screen Controllers, and Menu Config, as well as searched the forum for similar requests, and looked at Jmix’s AppUI.java file. I haven’t found a definitive answer for opening an editor screen in it’s own new tab. How should I go about achieving my intended results?
Thanks in advance,
Adam