Custom in-panel widget, create widget error

7854
16
03-19-2015 07:02 AM
VeronikaBraatz
New Contributor III

Hi Everyone,

i have some issues with getting the custom in-panel widget running. I followed the steps of Create a custom in-panel widget—Web AppBuilder for ArcGIS (Developer Edition) | ArcGIS for Developer... and also create a custom in panel widget problem​ and Question about creating custom in-panel widget.​ but the Widget is still not running correctly.

I can add it to a map, but as soon as I try to open it I get the following message:

"create widget error:

widgets/MyWidget/Widget"

Does anyone have some ideas about how to solve the problem?

Thanks a lot!

0 Kudos
16 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Veronika,

   There are a couple of reasons you would get this error. Can you look at your browsers developer tools and see what the console says?

0 Kudos
VeronikaBraatz
New Contributor III

My console returns the following:

TypeError: Für die Eigenschaft "$locale" kann kein Wert festgelegt werden: Das Objekt ist Null oder undefiniert

PROTOKOLL: panel [_5_panel] created.

PROTOKOLL: create [widgets/MyWidget/Widget] error:undefined

TypeError: Das Objekt unterstützt diese Aktion nicht.

The first error occurs when assigning the widget to Header-Controller, the second appears when trying to open the widget.

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Veronika,

   So it looks like the first error is an issue with your locale file (nls\strings.js) do you have one what is in it?

0 Kudos
VeronikaBraatz
New Contributor III

Hi Robert,

I have a string.js file but it only says:

define({

    root:({

       

    })

});

So I guess that's the root of the problem. Can you tell me what I need to write to that file?

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Veronika,

  What step in the document did you get to?  Step 8 is missing some instructions. Like if you un-comment the startup function then you have to place a comma behind the base class line:

baseClass: ' jimu-widget-mywidget',

And Step 9 the lines of code they want you to copy has some syntax issues (there is a double quote that does not match the others and a missing comma in step 9 part 1):

currently:

define({
  root:{
  label1: "This is my widget.
  label2: "This is configurable."
  },
  "zh-cn": true 
});

Should be:

define({
  root:{
  label1: "This is my widget.",
  label2: "This is configurable."
  },
  "zh-cn": true 
});

Jianxia Song

VeronikaBraatz
New Contributor III

Hi Robert,

thanks a lot for your help. Unfortunately it is still not working. Even after inserting the missing comma and changing the string.js file I still get the same error:

"SCRIPT5007: Für die Eigenschaft "$locale" kann kein Wert festgelegt werden: Das Objekt ist Null oder undefiniert

init.js, Zeile 32 Zeichen 464"

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Veronika,

   can you zip up your whole mywidgets folder and attach it for me to look at?

0 Kudos
VeronikaBraatz
New Contributor III

Hi Robert,

folder is attached

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

Veronika,

   I unzipped your folder and added it to my WAB dev version without changing anything and the widget works without error. Have you cleared your browsers cache? I tested in FireFox 36.03 and Chrome Version 41.0.2272.89 m and IE Version 11.0.9600.17691 and all browsers worked without issue.

0 Kudos