Widget's callback functions in Launchpad theme not working?

3189
4
Jump to solution
08-14-2015 11:48 AM
RomanChueh
New Contributor III

Hi, I created a custom widget with Web Appbuilder 1.2 developer version, and noticed the widget's callback functions behaved differently when I use Launchpad theme. For example, onOpen function is called only once when I opened it the first time, and onClose callback function is never called when I closes the widget panel.  is this a intended behavior, or is it a bug?

Thanks,
Roman

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Roman,

  Here is a work around you can apply to your widget to fix the onClose issue.

I add the dojo/aspect require and then in the postCreate function I add the code below.

        /*Workaround for the LanunchPad theme not firing onClose and onOpen for the widget*/
        if(this.appConfig.theme.name === "LaunchpadTheme"){
          var tPanel = this.getPanel();
          if(tPanel){
            aspect.after(tPanel, "onClose", lang.hitch(this, this.onClose));
            aspect.after(tPanel, "onOpen", lang.hitch(this, this.onOpen));
          }
        }
        /*end work around for LaunchPad*/

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Roman,

  Here is a work around you can apply to your widget to fix the onClose issue.

I add the dojo/aspect require and then in the postCreate function I add the code below.

        /*Workaround for the LanunchPad theme not firing onClose and onOpen for the widget*/
        if(this.appConfig.theme.name === "LaunchpadTheme"){
          var tPanel = this.getPanel();
          if(tPanel){
            aspect.after(tPanel, "onClose", lang.hitch(this, this.onClose));
            aspect.after(tPanel, "onOpen", lang.hitch(this, this.onOpen));
          }
        }
        /*end work around for LaunchPad*/
RomanChueh
New Contributor III

It's working great.  Thank you Robert. 

0 Kudos
JunshanLiu
Occasional Contributor III

It's the launchpad panel's bug, when panel is closed, it doesn't close its widget. This bug will be fixed in next release.

MariaNieves
New Contributor III

Is ESRI aware the same happens with the Tab Theme when the widget is located in the "Other Panels"?

0 Kudos