* Double-check that your getCMSFields() method is actually being called, for example by putting a Debug::message() call into it. If it's not being called, then you've probably put your getCMSFields() method in the wrong place.
- Find the start of the requireJs method, about line 46.
- Add console.log("Loading script: " + scriptUrl); at the beginning of the file.
- Is Loading script: (yourscript) getting listed in the Firebug console? If not, then the ondemand handler isn't loading your script for some reason and there's probably a bug in the ondemand handler.
I hope this helps!
I can see that the ondemand handler is loading the script and the script is running. However if I have something like:
it will not work but if I do this:
elementID = document.getElementById('ID');
The change event on elementID object works but inside the callback the "this" variable doesn't hold anything.
I tried putting the Requirement before the parent::getCMSFields and after but that doesn't make any difference.
My problem might be in my jQuery and not the ondemand handler.