Is it possible to open a “Screen Link” from inside an iframe, but without any menu bar in the top?
I do not want to permanently have the menu hidden, but only when using a specific “Screen Link”
Is it possible to open a “Screen Link” from inside an iframe, but without any menu bar in the top?
I do not want to permanently have the menu hidden, but only when using a specific “Screen Link”
Hi,
This behaviour is not implemented in the platform, but you can introduce it if you extend LinkHandler: Screen Links - CUBA Platform. Developer’s Manual
package com.company.demo.web;
import com.haulmont.cuba.gui.components.Component;
import com.haulmont.cuba.gui.components.Window;
import com.haulmont.cuba.gui.config.WindowInfo;
import com.haulmont.cuba.web.App;
import com.haulmont.cuba.web.sys.LinkHandler;
import java.util.Map;
public class CustomLinkHandler extends LinkHandler {
public CustomLinkHandler(App app, String action, Map<String, String> requestParams) {
super(app, action, requestParams);
}
@Override
protected void openWindow(WindowInfo windowInfo, Map<String, String> requestParams) {
super.openWindow(windowInfo, requestParams);
if (requestParams.containsKey("hideMenu")) {
Window.TopLevelWindow topLevelWindow = app.getTopLevelWindow();
if (topLevelWindow != null) {
Component titleBar = topLevelWindow.getComponentNN("titleBar");
titleBar.setVisible(false);
}
}
}
}
Here we analyse additional parameter hideMenu and if it is present in the URL we hide whole menu header.
<bean id="cuba_LinkHandler" class="com.company.demo.web.CustomLinkHandler" scope="prototype"/>
That’s it !