Select to view content in your preferred language

Renaming Enhanced Search Widget

2730
15
01-25-2017 11:24 AM
WilliamMiller4
Deactivated User

Hello,

I renamed Robert's Enhanced Search Widget after making some changes. I am able to go through the setup in web appbuilder, but when I click OK to complete the widget's configuration, I get the error below and no option to save the changes. The widget is copied to the app, but no config file is saved. I've removed my code and just changed the widget name in all the files (attached), and I've tried restarting WAB multiple times, but the problem persists. Any help is greatly appreciated.

Thank you.

William

TypeError: Cannot read property 'en-us' of undefined  init.js:113
  at Object.<anonymous> (FeatureActionManager.js?wab_dv=2.2:174)
  at Object.forEach (init.js:70)
  at Object.registerWidgetFeatureActions (FeatureActionManager.js?wab_dv=2.2:162)
  at Object.<anonymous> (FeatureActionManager.js?wab_dv=2.2:207)
  at init.js:63
  at visitBigSection (utils.js?wab_dv=2.2:120)
  at Object.visitElement (utils.js?wab_dv=2.2:85)
  at Object.c.visitElement (ConfigManager.js?wab_dv=2.2:177)
  at Object._reRegisterWidgetActions (FeatureActionManager.js?wab_dv=2.2:204)
  at Object._onAppConfigChanged (FeatureActionManager.js?wab_dv=2.2:252) "TypeError: Cannot read property 'en-us' of undefined
  at Object.<anonymous> (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/FeatureActionManager.js?wab_dv=2.2:174:82)
  at Object.forEach (http://js.arcgis.com/3.18/init.js:70:348)
  at Object.registerWidgetFeatureActions (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/FeatureActionManager.js?wab_dv=2.2:162:15)
  at Object.<anonymous> (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/FeatureActionManager.js?wab_dv=2.2:207:28)
  at http://js.arcgis.com/3.18/init.js:63:209
  at visitBigSection (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/shared/utils.js?wab_dv=2.2:120:13)
  at Object.visitElement (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/shared/utils.js?wab_dv=2.2:85:5)
  at Object.c.visitElement (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/ConfigManager.js?wab_dv=2.2:177:19)
  at Object._reRegisterWidgetActions (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/FeatureActionManager.js?wab_dv=2.2:204:19)
  at Object._onAppConfigChanged (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/FeatureActionManager.js?wab_dv=2.2:252:14)
  ----------------------------------------
  rejected at a (http://js.arcgis.com/3.18/init.js:108:174)
  at h (http://js.arcgis.com/3.18/init.js:107:438)
  at g.then.c.then (http://js.arcgis.com/3.18/init.js:110:152)
  at Object._onWidgetPoolChanged (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/ConfigManager.js?wab_dv=2.2:285:72)
  at f.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209)
  at f.c [as onbuilder/widgetPoolChanged] (http://js.arcgis.com/3.18/init.js:119:79)
  at Function.h.emit (http://js.arcgis.com/3.18/init.js:124:331)
  at Function.h.emit (http://js.arcgis.com/3.18/init.js:125:443)
  at f.emit (http://js.arcgis.com/3.18/init.js:117:218)
  at Object.publish (http://js.arcgis.com/3.18/init.js:169:289)
  ----------------------------------------
Error
  at g.then.c.then (http://js.arcgis.com/3.18/init.js:110:97)
  at Object._onWidgetPoolChanged (http://pcName.domainName:port/webappbuilder/apps/6/jimu.js/ConfigManager.js?wab_dv=2.2:285:72)
  at f.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209)
  at f.c [as onbuilder/widgetPoolChanged] (http://js.arcgis.com/3.18/init.js:119:79)
  at Function.h.emit (http://js.arcgis.com/3.18/init.js:124:331)
  at Function.h.emit (http://js.arcgis.com/3.18/init.js:125:443)
  at f.emit (http://js.arcgis.com/3.18/init.js:117:218)
  at Object.publish (http://js.arcgis.com/3.18/init.js:169:289)
  at Object.<anonymous> (http://pcName.domainName:port/webappbuilder/builder/main.js?wab_dv=2.2:2111:232)
  at f.<anonymous> (http://js.arcgis.com/3.18/init.js:63:209)"
0 Kudos
15 Replies
RobertScheitlin__GISP
MVP Emeritus

William,

   When you say rename do mean you have renamed the widget folder? If so what is the reasoning behind that? The eSearch has MANY hard coded paths that are expecting the widget folder to be eSearch.

0 Kudos
WilliamMiller4
Deactivated User

Hi Robert,

I want to include the original eSearch widget, but also a modified one in the same app. Web AppBuilder does not add an additional eSearch widget folder when I add a second eSearch widget, only a separate config file. I believe I changed all the necessary instances of 'eSearch' and 'esearch' in the widget to 'eLabels' and 'elabels', respectively. I can manually add the config folder/file for the eLabels widget and add it to the main config file, it would just be more convenient to use WAB.

William

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Did you look for eSearch in the .html files as well?

0 Kudos
WilliamMiller4
Deactivated User

Yes. The HTML, CSS, JSON and JS. The FeatureActionManager.js is indicated in the error message, so I don't know if that has something to do with it or not.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

William,

   Yes that is an indication that there is an issue with widget not finding the nls/strings.js _featureAction_* (i.e. _featureAction_eShowStatistics) because something is still pointing to eSearch. Have you double checked your main config.json to be sure that the eLabels widget has all the right eLabels paths?

0 Kudos
WilliamMiller4
Deactivated User

Robert,

When you say the main config.json, are you talking about the ../client/stemapp/config.json or ../client/stemapp/widgets/eLabels/config.json?

I did not make any changes to either of these files.

William

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Nope I am talking about [install dir]\server\apps\[app#]\config.json

Just check it as you would not have been the one to make the change it would have been builder.

0 Kudos
WilliamMiller4
Deactivated User

Hi Robert,

After I manually add eLabels to that config.json, I don't have a problem, or I haven't encountered one yet. The issue is I have to manually add that and the widget's config.json.

(I did notice that the i_search.png cannot be found when I click Edit Default Search Symbology, but that happens in the eSearch widget too.)

William

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

William,

   So you do not see a eLabels widget in the add widget dialog when you create a new app?

0 Kudos