Select to view content in your preferred language

lang.hitch scope is null error while building widgets

2498
13
02-27-2019 09:48 AM
Rohit_Venkat_GandhiMendadhala3
New Contributor III

I am trying to build a widget which will retrieve the place links if we type an address or drop a pin at a location. It will provide links to Google 3D, Birdseye view. But when I start the server and import the widget in my application it shows up this error that widget cannot be created.  When I look into the console, it shows that lang. hitch scope is null. Here is the screenshot for your reference.

Tags (2)
0 Kudos
13 Replies
Rohit_Venkat_GandhiMendadhala2
New Contributor II

Here is the attached folder.

Please check

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  Wow this widget is an absolute mess. Did you just copy some JS sample html source into the Widget.html and think that it would work? Your Widget.html has many divs that have ids and widgetids this is not normal for a WAB widget. You have many data-dojo-attach-events specified in the html that do not exist in the Widget.js.

0 Kudos
Rohit_Venkat_GandhiMendadhala2
New Contributor II

Robert, Yes I am trying to see how this widget works for the web applications. Have used chrome console for that.

I do not intend to copy but would like to replicate something similar to that for one of my projects. Hence I am trying on that.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rohit,

  Well you can get your widget to at least load if you add all the data-dojo-attach-events to your widget.js and make sure to add a name property to your widget.js as well.

0 Kudos