I'd like to use dojo/text! to populate the templateString for my 3D widget's Setting page programmatically, rather than the default behaviour of loading the Setting.html page in the widget's folder. I expected this should be possible if I set the hasSettingUIFile property to false in the manifest.json file.
Instead, I spotted a 404 in the network traffic. The url it was attempting to load was:
http://{my machine name}.{my domain}:3344/webappbuilder/null
I ended up working around it by overriding the "postscript" function like so:
(where "template" was populated via use of "dojo/text!{file path}" in the "define" method.)
Is this a bug in Web AppBuilder? The equivalent setting of hasUIFile seems to work correctly. It's just the settings page that has problems.
Also, the same setting seems to work in a 2D version of the widget. It's just the 3D one that's failing.
Ken,
When examining the code base for the 3D WidgetManager.js and the 2D WidgetManager.js the code seems to be identical for checking the manifest resources...
I am not sure why you are running into this issue. Have you double checked you spelling and cAsE for the property in the manifest.json?
Hi Robert,
Thanks for your response. I tried again and now it seems to be working fine. I'm not sure what exactly I had wrong before, but now I'm able to have:
in the manifest and delete the setting/Setting.html file from my widget folder in client/stemapp3d.
Also, I no longer need to wait until the postscript function to set the templateString, since it's not being sent to the contents of the default file. I can now do it in the constructor instead.
I'm not sure if this is due to a typo in manifest.json on my part or not. I've found in the past that for manifest file changes to take effect you need to actually kill the Web AppBuilder process and start it over. Perhaps I forgot to this while testing this feature.
Thanks again for your help!
The problem has returned. When I start with a clean install of WAB 2.10 and add my widget to client\stemapp3d\widgets, I get an error again when trying to add that widget to a 3D app. The manifest definitely has the correct capitalization:
"hasSettingUIFile": false
I'm going to re-add my workaround for now.