Select to view content in your preferred language

Is it normal to acces the Widget's config.json only when there is not setting Folder ?

1146
2
Jump to solution
08-25-2020 03:06 AM
AlexisCuicui
New Contributor II

Dear Community,

Since WebAppbuilder Developper Edition 2.16 (avaible for 2.17 too), I found some very strange behaviour of config files.

I am aware that there is two config.json for each widgets : 

   - One in the Widget Folder named "config.json" (I will calll it Widget JSON )

   - One in the "configs" folder in the app named "config_<label>.config.json" (I will call it App JSON )

I found a strange behaviour in the eDraw Widget, when calling this.config i expect this one to reach the Widget Json but it seems to call the App Json. (I tried to modifiy the default Symbols ).

When there is no setting folder in a Widget, this.config is calling the Widget Json but when there is settings, this.config is calling the App Json.

So here's my questions : 

- Is it normal ? If it is,what is the "Esri" way to access te Widget Json when there is settings inside a widget.

- Is it existing only since Wab 2.16 or did i missed it before ?

PS : I made 2 customs widgets test for some tests, i add them to this post. Tetsasup reach the configs/testasup/config_testasup.sjon when using this.config and in testasup_nosetting this.config reach the config.json inside the widget folder.

Thank you in advance for you time,

Alexis Cuicui.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Alexis,

   Yes that is normal and has been that way for a long time. The config.json file in the widgets folder is the default settings file for the widget and then when you make changes to the widgets settings then the app stores those changes in the apps configs folder. The way to access the widgets config file is to use this.config just like you have been. If the user has made and widget settings changes then the file that is accessed is the one in the apps configs folder, if not the the widgets default config.json will be used automatically. The way that you know which file to look for manually is in the apps main config.json file each widget is listed with the configuration path/file that it uses.

View solution in original post

2 Replies
RobertScheitlin__GISP
MVP Emeritus

Alexis,

   Yes that is normal and has been that way for a long time. The config.json file in the widgets folder is the default settings file for the widget and then when you make changes to the widgets settings then the app stores those changes in the apps configs folder. The way to access the widgets config file is to use this.config just like you have been. If the user has made and widget settings changes then the file that is accessed is the one in the apps configs folder, if not the the widgets default config.json will be used automatically. The way that you know which file to look for manually is in the apps main config.json file each widget is listed with the configuration path/file that it uses.

AlexisCuicui
New Contributor II

Robert,

Thank you for your confirmation. I wasn't sure about editing manually the config.json inside the app's folder.

Thank for you time,

Sincerely,

Alexis.

0 Kudos