Duplicate Oblique Viewer in Web AppBuilder

384
9
08-09-2019 03:18 PM
RichardButgereit
Occasional Contributor

I need to configure 2 instances of the Oblique Viewer with our custom Web AppBuilder app -- 1 to display images from one year/service, and the other to hit another year/service.

I have successfully cloned the ObliqueViewer widget -- copying the sourcecode, making a few changes to instantiate as different widgets (ie ObliqueViewer and ObliqueViewer2), but no luck.
You can only effectively use one or the other. 
Somewhere there must be a parameter that is conflicting between the 2. 

Anybody ever had any luck trying to do such?

Tags (2)
0 Kudos
9 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Richard,


  What theme are you using. Many themes only allow one widget to be open at a time. For example you can only have one on screen widget open at a time in the foldable theme and only on widget open from the header controller at the same time. You can make a change to the themes code to allow more though.

0 Kudos
RichardButgereit
Occasional Contributor

Using Launchpad Theme. 
Each widget effectively opens/closes -- but do not function correctly. Open the 2018 widget, and it works with it's respective layer -- but then close it and open the 2019 widget, and that one just doesn't work -- displaying no data or errors.

Close and re-launch the app -- open 2019 widget first, and it displays those images just fine, then open the 2018 widget, and it no longer displays those images. 

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Richard,

 OK. So you are saying that no errors are show in the browsers web console when you open the browsers developer tolls using F12?

0 Kudos
RichardButgereit
Occasional Contributor

When I first use one of the 2 ObliqueViewers -- there are no errors. 

But then close 1 and open the other - and yes there are errors --

WidgetManager.js?wab_dv=2.11:519 fail to close widget ObliqueViewer. TypeError: Cannot read property 'clear' of null
at Object._clearAll (https://laptop:3344/webappbuilder/apps/4/widgets/ObliqueViewer/Widget.js?wab_dv=2.11:382:29)
at Object.onClose (https://laptop:3344/webappbuilder/apps/4/widgets/ObliqueViewer/Widget.js?wab_dv=2.11:472:14)
at Object.closeWidget (https://laptop:3344/webappbuilder/apps/4/jimu.js/WidgetManager.js?wab_dv=2.11:517:18)
at Object.<anonymous> (https://laptop:3344/webappbuilder/apps/4/jimu.js/BaseWidgetPanel.js?wab_dv=2.11:172:30)
at Object.forEach (https://js.arcgis.com/3.27/init.js:71:486)
at Object.onClose (https://laptop:3344/webappbuilder/apps/4/jimu.js/BaseWidgetPanel.js?wab_dv=2.11:170:13)
at Object.advice (https://js.arcgis.com/3.27/init.js:120:313)
at Object.c [as onClose] (https://js.arcgis.com/3.27/init.js:120:103)
at Object.<anonymous> (https://laptop:3344/webappbuilder/apps/4/jimu.js/PanelManager.js?wab_dv=2.11:198:15)
at https://js.arcgis.com/3.27/init.js:64:337

0 Kudos
RichardButgereit
Occasional Contributor

And continuing trying to open/close the duplicated widgets --

undefined
init.js:586 Uncaught TypeError: Cannot read property '_getInfo' of undefined
at Object._getFrameWidth (init.js:586)
at Object._setClipRect (init.js:628)
at Object.onResize (init.js:606)
at Object.advice (init.js:120)
at Object.c [as onResize] (init.js:120)
at Object._resize (init.js:627)
at Object._execResize (init.js:625)
at Object._execResize (init.js:64)
at Object._timedResize (init.js:625)
at init.js:64

ObliqueViewer.js:32 Oblique viewer: records not provided.
setData @ ObliqueViewer.js:32
(anonymous) @ ObliqueViewer.js:26
l @ init.js:108
k @ init.js:108
resolve @ init.js:110
(anonymous) @ ObliqueViewer.js:27
c @ init.js:104
e @ init.js:104
resolve.callback @ init.js:106
_resDfd @ init.js:682
_successHandler @ init.js:2303
_handler @ init.js:2297
(anonymous) @ init.js:64
(anonymous) @ init.js:2292
c @ init.js:104
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:2301
(anonymous) @ init.js:2301
c @ init.js:104
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
(anonymous) @ init.js:1050
c @ init.js:104
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
c @ init.js:105
e @ init.js:104
resolve.callback @ init.js:106
(anonymous) @ init.js:93
l @ init.js:108
k @ init.js:108
resolve @ init.js:110
a @ init.js:109
l @ init.js:108
k @ init.js:108
resolve @ init.js:110
a @ init.js:109
l @ init.js:108
k @ init.js:108
resolve @ init.js:110
a @ init.js:109
l @ init.js:108
k @ init.js:108
resolve @ init.js:110
d @ init.js:140
f @ init.js:144
load (async)
r @ init.js:145
l @ init.js:141
b.xhr @ init.js:93
b.xhrGet @ init.js:93
B @ init.js:1046
f @ init.js:1048
I @ init.js:1056
(anonymous) @ init.js:1056
c @ init.js:104
B.then.then @ init.js:106
always @ init.js:113
F @ init.js:1056
execute @ init.js:2291
(anonymous) @ init.js:1234
c @ init.js:104
B.then.then @ init.js:106
addCallbacks @ init.js:106
c.<computed> @ init.js:1234
search @ ObliqueViewer.js:27
locate @ ObliqueViewer.js:26
onOpen @ Widget.js?wab_dv=2.11:114
openWidget @ WidgetManager.js?wab_dv=2.11:547
(anonymous) @ BaseWidgetPanel.js?wab_dv=2.11:164
forEach @ init.js:71
onOpen @ BaseWidgetPanel.js?wab_dv=2.11:162
d @ init.js:198
onOpen @ OnScreenWidgetPanel.js?wab_dv=2.11:239
(anonymous) @ PanelManager.js?wab_dv=2.11:169
(anonymous) @ init.js:64
l @ init.js:108
then.b.then @ init.js:111
openPanel @ PanelManager.js?wab_dv=2.11:167
showPanel @ PanelManager.js?wab_dv=2.11:57
switchToOpen @ OnScreenWidgetIcon.js?wab_dv=2.11:153
onClick @ OnScreenWidgetIcon.js?wab_dv=2.11:85
(anonymous) @ OnScreenWidgetIcon.js?wab_dv=2.11:50
(anonymous) @ init.js:64
Show 72 more frames

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Richard,

  It is hard to say what the issue is, but it sounds like you missing changing something that will let the two widget be seen as separate instances. Did you change the manifest.json name and label and the strings.js _widgetLabel?

0 Kudos
RichardButgereit
Occasional Contributor

Thanks -- yep, I think that is the problem. Made all kinds of changes to manifest.json and strings.js to force that they are 2 different widgets -- and no luck. Same response -- first one you open will work and continue to work, but second one fails. 

How exactly is the widgetId set? I see names and other other properties for widgets in the code, but not the widgetId? Do you know how that is set?

0 Kudos
MattPohl
Occasional Contributor II

Richard-

Did you ever get this figured out? I have a custom widget that behaves the exact same way and can not figure out why the 2 can't act separate. I have set properties to support multiple instances, changed names in the manifest.js and strings.js but to no avail. It has been driving me nuts trying to solve this. 

0 Kudos
RichardButgereit
Occasional Contributor

Sorry, no. I gave up. 

0 Kudos