How to call a screen from a button

Hi everyone,
I have a screen called demo$test.browse
I want to create a button such that when I click the button it displays the screen.
so far my implementation only works with openType dialogue which does not have a work area , i.e:

 public void displayScreen(){
       openWindow("demo$Test.browse",
               WindowManager.OpenType.DIALOG.width(800).height(300).closeable(true).resizable(true).modal(false));
  }

please help to display the screen which with create/edit button.

Where your button is located?

Hi,
thank you for replying.
Am reusing the dashboard demo and my button is located at the side menu.

   @Override
    public void init(Map<String, Object> params) {
        setChartData();
        setPieChartData();
        initMap();
        initTable();
        initSideMenu();
    }
private void initSideMenu() {
        SideMenu.MenuItem dashboardMenuItem = sideMenu.createMenuItem("dashboard",
                getMessage("dashboard"),
                "icons/dashboard.png",
                menuItemAction -> buttonNotImplementedAction()
        );
		  dashboardMenuItem.setStyleName("menubutton-selected");
        sideMenu.addMenuItem(dashboardMenuItem);	
//here goes my button
        sideMenu.addMenuItem(
                sideMenu.createMenuItem("testButton",
                        getMessage("testButton"),
                        "icons/car.png",
                        menuItemAction -> displayScreen())
        );
		}

see the button in the screenschot below
screenshots

Then you have probably already got an answer in this topic: Re-using the Responsive screen demo - CUBA.Platform

1 Like

yeah, I did it finally, thank you. I’ll be back when I get more challenges.