Hi,
There is a mistake in the platform documentation: custom main window should be registered in the ‘modules\web\src\web-screens.xml’. Because it works only in the web module.
To simplify the main window creation Studio presents special functionality:
Open the ‘Screens’ tab in the main menu (left-hand panel)
Find the ‘Create main window’ link.
When the link is pressed, an extension of the main window is created automatically.
Thank you for a good question, we will fix documentation soon.
Hi Rostislav
Thank you so much. And about my 3rd question, do you suggest I use init method where I call the screen that I want to show immediately after log-in and showing the mainWindow?
Hi Rostislav
As I want t o create work area, header, footer etc. in the main window, I have created the main window as advised. However, after I have created the main window following the XML code in the user guide, i am having an exception as follows:
Hi,
If you want to create clear Main window (using XML from the documentation), you should inherit it from the AbstractMainWindow - class. Modify your MainWindow.java as follows:
package com.company.sample.gui;
import com.haulmont.cuba.gui.components.AbstractMainWindow;
public class MainWindow extends AbstractMainWindow {
}
After that the code from documentation should work well.
ExtMainWindow generated by Studio extends AppMainWindow. The ‘id’ attribute of redefined components should be specified in that case. So the NPE during login occurs because the id = “mainMenu” was not set for the main:menu component in your XML descriptor.
Considering your 3rd question:
Required screen could be opened right after login from the ‘ready()’ method of the Main window.
The information of how to open the screen could be found here: AbstractFrame - CUBA Platform. Developer’s Manual
public class ExtAppMainWindow extends AppMainWindow {
@Override
public void ready() {
super.ready();
openWindow("demo$Customer.browse", WindowManager.OpenType.THIS_TAB);}
Hi
I want the new main window to be exactly the same in the user guide sample I.e. Having work area, footer area etc. Wondering if there is anything wrong as its not working.