AnsweredAssumed Answered

Open Print widget

Question asked by tjlemahieu on Jun 6, 2016
Latest reply on May 11, 2018 by jamesfreddyc

I'm trying to open the Print widget from another widget.  If the widget has already been loaded I have no problem. If the print widget hasn't been loaded, it creates the widget and it creates the panel, but nothing shows. How do I show the panel?

 

Console:

     widget [widgets/Print/Widget] created.

     PanelManager.js:83 panel [widgets_Print_Widget_35_panel] created.

 

Code:

      _openPrintWidget: function () {

        if (this.wManager) {

            var widgetCfg = this._getWidgetConfig('Print');

            if(widgetCfg){

                var printWidget = this.wManager.getWidgetByLabel(widgetCfg.label);

                if(printWidget){

                    this.wManager.openWidget(printWidget);

                    this.pManager.showPanel(printWidget);

                } else {

                    this.wManager.loadWidget(widgetCfg).then(lang.hitch(this, function(widget){

                        if(widget){

                            this.wManager.openWidget(widget);

                            this.pManager.showPanel(widgetCfg);

                        }

                    }));

                }           

            }

        }

      },

Outcomes