Custom widget settings

4483
6
Jump to solution
02-13-2015 12:08 PM
TimWitt2
MVP Alum

Hey everybody,

I am in the process of building a custom widget and have a problem when I want to add it to an app.

Here is what happens. I click on the widgets tab, click on an empty widget space and then I choose my widget from the list.

A box pops up, where normally would be settings of my widget, but I don't have any. This causes an error (it can't find the settings.js), I can click on OK and the widget will work, but I want to remove that error.

Looking at the help file, you don't have to have settings.

So my question is, what do I need in the settings folder, so that the error disappears? Does anybody have a basic settings folder?

Thanks,

Tim

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Tim,

  I have yet to do a widget that has a config.json and not a settings.js. Here is a more complete list of manifest properties:

"properties": {

    "inPanel":true,

    "hasLocale":true,

    "hasStyle":true,

    "hasConfig":true,

    "hasUIFile":true,

    "hasSettingPage":true,

    "hasSettingUIFile":true,

    "hasSettingLocale":true,

    "hasSettingStyle":true,

    "IsController":false,

    "hasVersionManager": false

  }

You can try setting all the settings properties to false.

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Tim,

   In the manifest.json specify that your widget does not have a UI:

"properties": {

    "inPanel": true,

    "hasConfig": true,

    "hasStyle": false,

    "hasUIFile": false

  }

TimWitt2
MVP Alum

Thanks Robert. I think I need your number on speed-dial!

TimWitt2
MVP Alum

Robert Scheitlin, GISP‌ I marked it correct too quickly, after testing it, it still doesn't work.

Once I started using these properties:

  "properties": {
  "inPanel":true,
  "hasLocale": true,
  "hasStyle":false,
  "hasConfig":true,
  "hasUIFile":true,
  "hasSettingPage":false,
  "IsController":false
  }

It started working, but now I have the following screen, where settings would usually be. This screen I would like to say "No settings at this time"

widget.png

Tim

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Tim,

  I have yet to do a widget that has a config.json and not a settings.js. Here is a more complete list of manifest properties:

"properties": {

    "inPanel":true,

    "hasLocale":true,

    "hasStyle":true,

    "hasConfig":true,

    "hasUIFile":true,

    "hasSettingPage":true,

    "hasSettingUIFile":true,

    "hasSettingLocale":true,

    "hasSettingStyle":true,

    "IsController":false,

    "hasVersionManager": false

  }

You can try setting all the settings properties to false.

TimWitt2
MVP Alum

Robert,

you are right, sooner or later I will need all those files. Sadly I am not as advanced in javascript and wish ESRI would have included those files (a settings folder) with the demo widget, with the bare minimum of information needed in them.

Maybe that could be one of your project when you have some time on your hands

In my case I will eventually need to text boxes in the config screen and depending what the user types in there it will replace code in my widget.js file.

Tim

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Tim,

Don't forget to mark this thread as answered. To do this you have to open the thread (you can not see the correct answer link from inside your inbox) and then you will see the green star with correct answer link. Just click that link on the thread that answered your question.

0 Kudos