I am trying to replicate the code in "Need simple example: add tabs to widget" on GeoNet but I get: TypeError: Cannot read property 'domNode' of undefined
at Object._createTab (TabContainer.js?wab_dv=2.6:91)
Here are my files:
style.css:
Widget.html:
Widget.js:
Based on the console.log messages that I have included in the above code, it dies in the following section:
Would you have any suggestions on how I could resolve this?
Michel,
Sounds crazy but switch the array order in this line of your code.
return declare([_WidgetsInTemplateMixin, BaseWidget], {
to
return declare([BaseWidget, _WidgetsInTemplateMixin], {
BaseWidget need to be first.
Robert,
I have just changed the order as stated and I still get the same error:
Michel,
So based on the error can I take it that you are using WAB 2.6?
Robert,
Yes, I am using WAB 2.6 with Portal 10.6.
Hi Robert,
Is the fact that I am using WAB 2.6 the issue? Is there a way around to resolve this issue while continuing to use 2.6 and if not then what version of Portal and WAB would be required?
I just asked about the version so I could do testing in that version. 2.6 is a little old considering we are at 2.17 now. But I know my identify widget that uses tabs worked fine back in 2.6. I can not test in Portal 10.6 though. Can you add my identify widget 2.5 version to your Portal and make sure that there is not a bigger WAB issue on your end. If that widget works with Tabs then it is a issue specific to your widgets code (that I can not see).
https://community.esri.com/docs/DOC-3250-identify-widget-version-215-6162020
Robert,
I ran your identify widget 2.5 version on my machine and it is working fine. I will compare it with my code and make the appropriate changes. I may ask you some question later on but for now I will get busy.
I really appreciate your help!
Robert,
Looking at your Identify widget, I see that your "startup: function ()" is "(property) startup: type startup"
while the "startup" in my widget is "(property) startup: (...agrs: any[]) => void
How do I make my "startup" a type of startup?
Michel,
That tells that your line this.tabContainer is not returning an actual jimu/dijit/TabContainer. Now why is whats hard to say. It looks like your module order is correct in your define.