Config.json shown instead of the setting UI

2821
1
Jump to solution
04-05-2016 11:44 PM
PavelVeselský1
New Contributor III

I copied the setting page from the Demo widget and I try to adjust it to suit my widget. My config.json contains the configText variable and several others as well. When I open the config window for my widget in app1, I see only the config.json contents, not UI as for other widgets. I can edit the JSON code freely.

So far I found no way to use any more complex debugging options or even how to debug the settings.js through FireBug (I can debug Widget.js, which works), so I can't confirm that the setting code is not even loaded, but it doesn't seem to respond to changes in my setting.js or setting.html files. The files seem to be on their places (config is read from WAB/server/apps/6/configs/MyWidget/config_MyWidget.json and the widget from WAB/server/widgets/MyWidget/), though I might have forgotten to check something. The setting code is exactly like in the Demo widget, except I renamed baseClass from jimu-widget-demo-setting to jimu-widget-my-widget-setting.

What else can I do, and especially, why do I get the json instead of the UI?

Full disclosure: I've reposted this from gis.stackexchange.com.

0 Kudos
1 Solution

Accepted Solutions
PavelVeselský1
New Contributor III

I have another app, let's call it app2. In it, my widget's settings returned an error: Create widget setting page error:widget/MyWidget/Widget I tried to find out the reason for the different behavior, so I copied the setting code from app1 to app2. Before, there was an error in app2 due to failed attempt to copy another widget's settings there (more complex than the Demo widget's), and it was corrected by this simplification, so the settings page shows normally now in app2. In app1, I still saw the config.json until I found that I have the "hasSettingPage", "hasSettingUIFile", "hasSettingLocale" and "hasSettingStyle" set to false. I changed them to true and the issue is solved.

View solution in original post

0 Kudos
1 Reply
PavelVeselský1
New Contributor III

I have another app, let's call it app2. In it, my widget's settings returned an error: Create widget setting page error:widget/MyWidget/Widget I tried to find out the reason for the different behavior, so I copied the setting code from app1 to app2. Before, there was an error in app2 due to failed attempt to copy another widget's settings there (more complex than the Demo widget's), and it was corrected by this simplification, so the settings page shows normally now in app2. In app1, I still saw the config.json until I found that I have the "hasSettingPage", "hasSettingUIFile", "hasSettingLocale" and "hasSettingStyle" set to false. I changed them to true and the issue is solved.

0 Kudos