neutrino36
(neutrino neutrino)
September 3, 2019, 8:50am
#1
HI,
Is it possible to re-do the WindowManger code into imported Cuba 7 application (from Cuba 6)?
@Override
public void ready() {
super.ready();
openWindow("crm$Transaction.browse", WindowManager.OpenType.THIS_TAB);
mainMenu.getMenuItems()
.forEach(this::addStyleNameRecursive);
}
I tried to use
@Inject
private ScreenBuilders screenBuilders;
(but I don’t know which method I have to choose).
minaev
(Vladislav Minaev)
September 3, 2019, 9:29am
#2
Hi, the equivalent is:
screenBuilders.screen(this)
.withScreenId("crm$Transaction.browse") // or better use .withScreenClass
.withLaunchMode(OpenMode.THIS_TAB)
.build()
.show();
jreznot
(Yuriy Artamonov)
September 3, 2019, 9:32am
#3
You can even skip build()
if you do not need additional preparations:
screenBuilders.screen(this)
.withScreenClass(TransactionBrowse.class)
.withLaunchMode(OpenMode.THIS_TAB)
.show();
1 Like
neutrino36
(neutrino neutrino)
September 3, 2019, 10:18am
#4
Thank you very much! It works perfectly.
For me is not quite clear what “build” does?
Seems to have the same behaviour (with or without build). What means additional preparations?
minaev
(Vladislav Minaev)
September 3, 2019, 1:40pm
#5
.build()
returns an instance of Screen
so that you can call some methods of this particular screen’s API before showing it.
TransactionBrowse transactionBrowse = ScrescreenBuilders.screen(this)
.withScreenClass(TransactionBrowse.class)
.withLaunchMode(OpenMode.THIS_TAB)
.build();
transactionBrowse.setSomething();
transactionBrowse.show()
neutrino36
(neutrino neutrino)
September 3, 2019, 2:08pm
#6
Ok. Now is clear.
Thank you!