Cuba ver. 6.8.8
Steps to reproduce:
- add a sidmenu or responsive sidemenu with Studio
- start Tomcat normally
- execute deploy Gradle task in IntelliJ IDEA
- the side menu stops working
The exception thrown is:
IllegalArgumentException: object is not an instance of declaring class
There’s no way to make it work again unless a full restart is done.
Hereunder the files (Studio made) defining the sidemenu:
ext-mainwindow.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<window xmlns="http://schemas.haulmont.com/cuba/window.xsd"
caption="mainMsg://application.caption"
class="com.idieffe.patientscheduler.web.screens.ExtAppMainWindow"
xmlns:main="http://schemas.haulmont.com/cuba/mainwindow.xsd">
<layout responsive="true"
stylename="c-sidemenu-responsive">
<hbox id="horizontalWrap"
expand="workArea"
height="100%"
stylename="c-sidemenu-layout"
width="100%">
<cssLayout id="sideMenuPanel"
height="100%"
stylename="c-sidemenu-panel">
<button id="mobileMenuButton"
caption="mainMsg://app.menu"
icon="icons/mobile-menu.png"
stylename="primary c-sidemenu-toggle"/>
<hbox id="mobileButtonsBox"
stylename="c-sidemenu-mobile-buttons">
<main:newWindowButton id="mobileNewWindowButton"
description="mainMsg://newWindowBtnDescription"
icon="app/images/new-window.png"/>
<main:logoutButton id="mobileLogoutButton"
description="mainMsg://logoutBtnDescription"
icon="app/images/exit.png"/>
</hbox>
<hbox id="appTitleBox"
spacing="true"
stylename="c-sidemenu-title"
width="100%">
<label id="appTitleLabel"
value="mainMsg://application.logoLabel"/>
</hbox>
<cssLayout id="sideMenuWrap"
stylename="c-sidemenu-wrap">
<embedded id="logoImage"
align="MIDDLE_CENTER"
stylename="c-app-icon"
type="IMAGE"/>
<main:userIndicator id="userIndicator"
width="100%"/>
<hbox id="mainButtonsBox"
stylename="c-main-buttons">
<main:newWindowButton id="newWindowButton"
description="mainMsg://newWindowBtnDescription"
icon="app/images/new-window.png"/>
<main:logoutButton id="logoutButton"
description="mainMsg://logoutBtnDescription"
icon="app/images/exit.png"/>
</hbox>
<main:timeZoneIndicator id="timeZoneIndicator"
width="100%"/>
<main:sideMenu id="sideMenu"
sidePanel="sideMenuPanel"
sidePanelToggleButton="mobileMenuButton"/>
<main:ftsField id="ftsField"
width="100%"/>
</cssLayout>
</cssLayout>
<main:workArea id="workArea"
height="100%">
<main:initialLayout margin="true"
spacing="true">
<label id="welcomeLabel"
align="MIDDLE_CENTER"
stylename="c-welcome-text"
value="mainMsg://application.welcomeText"
width="100%"/>
</main:initialLayout>
</main:workArea>
</hbox>
</layout>
</window>
ExtAppMainWindow.java
package com.idieffe.patientscheduler.web.screens;
import com.haulmont.cuba.gui.components.AbstractMainWindow;
import com.haulmont.cuba.gui.components.Embedded;
import com.haulmont.cuba.gui.components.mainwindow.FtsField;
import javax.inject.Inject;
import java.util.Map;
public class ExtAppMainWindow extends AbstractMainWindow {
@Inject
private FtsField ftsField;
@Inject
private Embedded logoImage;
@Override
public void init(Map<String, Object> params) {
super.init(params);
initLayoutAnalyzerContextMenu(logoImage);
initLogoImage(logoImage);
initFtsField(ftsField);
}
}