AnsweredAssumed Answered

Open widget from scalebar widget

Question asked by jamesfreddyc on May 11, 2018
Latest reply on May 11, 2018 by jamesfreddyc

Theme: Launchpad

WabDev 2.7

 

I'm trying to implement what is found in THIS thread.  I need to open a widget from the ScaleBar widget when the app loads.  However, the var abc is getting set to undefined and not sure why.

 

var widgetsConfig = this.appConfig.widgetPool.widgets;
            var widgetId;
            for (var i in widgetsConfig) {
                if (widgetsConfig[i].name == "My Widget Name") {
                    widgetId = widgetsConfig[i].id;
                    break;
                }
            }
            var abc = WidgetManager.getInstance().getWidgetsByName("AnchorBarController")[0]; //abc is getting set to undefined
            debugger;
            abc.setOpenedIds([widgetId]);

Outcomes