Custom widget config problems

2144
3
12-16-2016 09:27 AM
TyroneLigon
Occasional Contributor

I have a custom widget where I wanted to use its config file to hold a URL for a help page. Using the example from the "Make widget configurable" page, I put the URL in the widget's config.json file. In the widget's HTML template, I embed the URL in an anchor tag using ${config.helpUrl}. When the widget is opened in the application, a widget error occurred because the JSON couldn't be read in. I then edited the widget's config entries in the widgets-manifest and widgets-manifest-builder files to read "hasConfig: true".  After that change, the widget loaded, the URL was embedded, and the help file opened upon a click of the icon in the HTML template.

Here's the problem (finally): when the widget is loaded into a new application through the Web App Builder, the configuration page displays but never resolves. The console error is "ace is not defined"; the error occurs in builder/main.js at line 888 (app is on an intranet, so I can't post the stack trace). I can click the "OK" button and the widget is added to the app, but I don't want to have to add a caveat to our documentation that says "click OK on the config page".

Are my config files configured incorrectly?

Tags (1)
0 Kudos
3 Replies
RobertScheitlin__GISP
MVP Emeritus

Tyrone,

   If you do not have any setting that need to be made for the widget when the widget is added then in the manifest.json for your widget just be sure to have "hasSettingPage" : false and be sure that you do NOT have a settings folder in your widget directory.

0 Kudos
TyroneLigon
Occasional Contributor

The manifest files for the widget itself and the builder and viewer apps have that setting pegged as "false"; however this is useful info because I haven't seen this documented anywhere.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus