I am developing a custom WAB widget that needs to coexist with other widgets in the same application. Currently, I have two widgets, call them A and B respectively.
Has anyone experienced a similar problem?
Regards,
Jacob Nosal
Jacob,
It sounds like you are using dom ids in your widget.html instead of data-dojo-attach-point like you should in templated widgets.
Thanks Robert. Ids are used in widget B. Would that cause widget A to not render?
Could. You should not use dom ids in any templated widget development.
I just purged dom ids from widget B and am having the same problem.Can you recommend a style guide or template structure wiki?
WAB widgets use the dojo templated widgets Structure. So search for dojo templated widget tutorial. You can also zip up your widgets and I will look them over for you.
I have used the Yeoman generator esri-appbuilder-js:widget from the ESRI github. Would that give me the appropriate template? I am reading about the structure of a dojo templated widget right now.
Jacob,
Yes I would totally expect it to give you the proper structure. But when you add to the Widget.html you just need to maintain the same practices (meaning no use of don ids). And there is many more best practices when it comes to the Widget.js (like this.own and lang.hitch, etc).