Cannot get PanelManager to load in WAB app

735
4
Jump to solution
03-20-2020 07:57 AM
JustinBridwell2
Occasional Contributor II

I am trying to utilize PanelManager in my WAB widget. My WAB version is very old (1.2). I am trying to add it as follows:

define([
//dojo AMD modules
...

//dojox AMD modules
..

//dGrid AMD modules
...

//dijit AMD modules
...

//esri AMD modules
...

//jimu web appbuilder AMD modules
'jimu/BaseWidget',
'jimu/utils',
'jimu/WidgetManager'
'jimu/ PanelManager '

],
function (
//dojo AMD modules
...

//dojox AMD modules
...

//dgrid AMD modules
...

//dijit AMD modules
...

//esri AMD modules
...

//jimu web appbuilder AMD modules
BaseWidget,
utils,
...

WidgetManager
PanelManager

) {

// Code goes her

Notice that there are spaces when I add 'jimu/ PanelManager '. This is exactly the way the documentation has it, but when I try to launch my app, it doesn't load because it is incorrect. When I change it to  'jimu/PanelManager' (with spaces removes it loads, but when I try to create an instance variable (see below), I get the error:  "Uncaught ReferenceError: PanelManager is not defined". What am I doing wrong here?

wm.loadWidget(myWidget);
wm.openWidget(myWidget);
var pm = PanelManager.getInstance();
pm.showPanel(myWidget);

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Justin,

   I just checked an old 1.2 version and I have 

'jimu/PanelManager',

And I call it this way

this.pManager = PanelManager.getInstance();

Without any error.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

Justin,

   There is No space in there the documentation has a typo.

JustinBridwell2
Occasional Contributor II

I eliminated the spaces, but I still got the "Uncaught ReferenceError: PanelManager is not defined" whenever I tried to create an instance of the PanelManager:

     var pm = PanelManager.getInstance();

     

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Justin,

   I just checked an old 1.2 version and I have 

'jimu/PanelManager',

And I call it this way

this.pManager = PanelManager.getInstance();

Without any error.

0 Kudos
JustinBridwell2
Occasional Contributor II

Aha! I just tried using `this.` That seemed to do the trick. 

0 Kudos