6 Sep 04:03
HopObject Constructor
Julian Tree <julian.tree <at> gmail.com>
2006-09-06 02:03:25 GMT
2006-09-06 02:03:25 GMT
Is there a way to override the hopobject constructor so we can set
some default value into the HopObject when it is first created. So
when all the subclass are created it will inherit parent class's
constructor as well
For example, something like
HopObject._constructor = function(){
this.creationtime = new Date();
this.user = session.user.username;
}
Later when I do (assuming Job is user defined HopObject)
var job = new Job();
res.write(job.creationtime); // output current time
I've searched the mailing list did find a few messages about "Allow
prototypename for constructor function"
http://helma.org/pipermail/helma-dev/2006-April/002701.html
but there is no documentation on how to use it, and it seems to have
some problem with inheritance.
Julian
RSS Feed