Opening and closing panels through Programmatically in WAB for Box theme is not working

495
1
Jump to solution
10-24-2019 10:54 PM
Naveen_KumarKairamkonda
Occasional Contributor

Hi,

I am trying to open the other panel and closing the current panel by using the below code, which is working for Foldable theme in WAB but not working for Box theme correctly.

var pm = PanelManager.getInstance();
var layerListWidget = null;
layerListWidget = pm.widgetManager.appConfig.widgetPool.widgets[0];
PanelManager.getInstance().closePanel(this.id + "_panel");
PanelManager.getInstance().showPanel(layerListWidget);

Do anyone have any idea, how to achieve this for Box Theme?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   You need to do this through the BoxController. Use the setOpenedIds method, it handles closing opened widget and opening the one you want opened.

var bc = WidgetManager.getInstance().getWidgetsByName("BoxController")[0];‍
bc.setOpenedIds([layerListWidget.id]);‍‍

View solution in original post

1 Reply
RobertScheitlin__GISP
MVP Emeritus

Naveen,

   You need to do this through the BoxController. Use the setOpenedIds method, it handles closing opened widget and opening the one you want opened.

var bc = WidgetManager.getInstance().getWidgetsByName("BoxController")[0];‍
bc.setOpenedIds([layerListWidget.id]);‍‍