No constructor found for widget

0
I've searched the forum and found 1 post with this title, but was a deployment issue. I'm writing some Chart Widgets for Mobile using Mendix 4. No matter what I do, I still keep on getting a "No constructor found for widget " error in my page. I went so far as to copy the contents from the Google Maps widget for Mobile, and replacing only the widget name and I'm still getting it, leaving me to believe the problem lies somewhere else entirely. I would love some assistance as this is taking way too much time. I'm stumped. Here is a screenshot from the modified widget source:
asked
3 answers
1

First observation from the screenshots: The dojo.declare specifies another name than gets reported in the error message.

Combo_Chart_Mobile.Combo_Chart_Mobile 
vs. 
Google_Charts.Combo_Chart_Mobile

Did you specify the correct widget id in the Combo_Chart_Mobile.xml ?

answered
2

Unfortunately I cannot pinpoint the cause of the error in this specific situation.

I have had this error quite a few times myself. Even if the constructor is in the source, failure or exceptions during its execution also produce this error. Putting some console.log statements in the source may help you find out how far it actually gets.

Also, I highly recommend writing strict JavaScript only.

http://www.jslint.com/

Google 'strict JavaScript' and 'jslint' and put a jslint or jshint plugin in your editor.

Really frustrating at start but a life saver in the long run as the plugin detects common coding errors and forces a specific coding style that prevents a lot of misery.

answered
0

I have had exactly this problem this morning, you should in fact just double check your .js for syntax error's. I found one and when fixed it solved my problem.

Make sure you write the correct code.

answered