[Helma-user] HopObject Constructor

Julian Tree julian.tree at gmail.com
Wed Sep 6 04:03:25 CEST 2006


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 


More information about the Helma-user mailing list