How to redirect another page when click menuitem

How to redirect another page when click menuitem


You can perform custom actions instead of opening application windows if you register custom screen in web-screens.xml.

  1. Create a Java class that implements Runnable and opens web page using WindowManager:

import com.haulmont.cuba.web.App;
import com.haulmont.cuba.web.WebWindowManager;

public class OpenExternalWebPage implements Runnable {
    public void run() {
        WebWindowManager wm = App.getInstance().getWindowManager();
        wm.showWebPage("", null);
  1. Register this class in web-screens.xml using IDE:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<screen-config xmlns="">
    <include file="com/company/demo/screens.xml"></include>
    <screen id="externalWebPage"
  1. Create a menu item in Studio with id of the registered screen

In version 6.5 you will be able to set class or bean/beanMethod directly to menu item from Studio.