This Mixin Class works with most in-panel and on-screen (with icon) Web AppBuilder widgets.
Live Preview Site
Changes in Version 1.1.3
Changes in Version 1.1.2
Bug Fixes in Version 1.1.1
Larrys Custom WAB Widgets and More
So far I have not been able to get the widget meta info. I am holding the Alt key and clicking on the widgets header and nothing...
Also about every other time visiting your preview site it errors out on me with this in the console:
DOMException [InvalidAccessError: "A parameter or an operation is not supported by the underlying object"
location: http://gis.hamiltoncounty.in.gov/mapviewer/widgets/WelWhatDisHelpAbout/WelWhatDisHelpAbout.js:974] "welWhatDisHelpAbout<._getCSSProperties@http://gis.hamiltoncounty.in.gov/mapviewer/widgets/WelWhatDisHelpAbout/WelWhatDisHelpAbout.js:974:10
I discovered the _WidgetMetadataMixin is only working in Chrome. I'm working it now. Thanks for the error dump. It looks like there is enough information for me to work that also. I'll post again when I get these solved.
Since I discovered the problem, I never updated the sample site, so it won't work even in Chrome unless you try my dev site, which is not necessarily stable all of the time. ArcGIS Web Application .
I fixed two issues that affected the mixins in FireFox and IE:
While using the console in FireFox and IE, I discovered and fixed multiple other assorted minor issues. Why can't all the browsers just get along?
I've updated the Live Preview site now, so let me know what you think.
I've made a note to investigate the other errors you were getting. When I was a younger man, I did some things in the WelWhatDisHelpAbout Widget that look very strange to me now. I'm hoping to rewrite the offending function tomorrow.
P.S. Thanks for the feedback. I hate bugs!
Thanks to Robert for his support on this. We've been communicating privately, so I thought I'd write a wrap-up to the problem/solution.
First, the _WidgetMetadataMixin was tricky to get working in all browsers because of three (not two) reasons:
Second, in my WelWhatDisHelpAbout Widget, I have created live widget buttons in the Help tab. If you hover over a widget button in the Help tab, it changed its style just like the real widget button. If you click on a widget button in the Help tab, it opens the widget. This is pretty cool, but requires scanning the style sheets to discover the styles to use. Scanning the style sheets can be a real adventure in different browsers. FireFox throws a "SecurityError" exception if you try to read a style sheet from a different domain (e.g. http://js.arcgis.com/3.13/...). Once you have the style sheet object, Chrome and IE (9) have both rules and cssRules properties, but FireFox has only a cssRules property.
I could only reproduce the error Robert was getting in the FireFox console if I disconnected from my network, opened Fiddler2, and set the performance in Fiddler2 to "Simulate Modem Speeds". Even then, the error was intermittent. If you are old enough to remember dial-up modems, you know how long the debugging took. Two to three minutes to load the application, which in human time, seems like two to three months.
I ended up rewriting the offending function twice before we got the problem solved. And the problem was not just the error in the FireFox Console. It wasn't always reading the style sheets, which means the widget buttons in the Help tab weren't getting styled correctly.
As far as I know, it is working correctly now. If you find a problem, please let me know.