dojo Error: this._getPropContext is not a function

firebug_msg.jpgThere are situations when you are hunting a bug and you got the feeling that it actually is no real bug, it’s just a typo or something as simple, but you just can’t find it. So I better write that down so next time I am searching for this error message I will get the result right away. Those are the kind of errors that are just nasty but time consuming. Actually it’s a PTS bug, Programmer too stupid bug.

I have written a little class for my current page, nothing fancy and not really any substantial code in there. But somehow I still get this nasty error, that Firebug (btw a must have tool) shows as you can see in the image.


dojo.declare("myproject.page.ideas", myproject.page,
    function(pageData) {
        // initialize the class here right on it's instanciation
    }, {
    onPageLoaded:function() {
        // Is being called by the parent class, when dojo.addOnLoad() hits.
    }
});

var page = myproject.page.ideas({});

At some point you are getting blind looking at you code, and so it was here. The problem is very simple. I forgot the “new” before the class instantiation (let’s not discuss if it is a class, object, type, …).


var page = new myproject.page.ideas({});

1 Comment »

  1. Pythoneer » Dojo, objects and classes said,

    March 30, 2007 at 12:02 pm

    [...] a short example, I have a base class for a page (as you used here). If the page also contains forms then I also use the “myproject.form” class, that I [...]

RSS feed for comments on this post · TrackBack URL

Leave a Comment