Hi,
I tried to define two constructors in a class, but when I create an object,
the second constructor is always called.
Example:
qx.Class.define("webshop.classes.business.Category",
{
extend: qx.core.Object,
properties: {
id: { init: null, check: "String" },
description: { init: null, check: "String" },
subCategories: { init: null, check: "qx.data.Array" },
category: { init: null, check: "webshop.classes.business.Category" }
},
construct: function(id){
this.base(arguments);
this.setId(id);
},
construct: function(id, description, subCategories, category){
this.base(arguments);
this.setId(id);
alert("bla");
this.setDescription(description);
this.setSubCategories(subCategories);
this.setCategory(category);
},
members :
{
}
});
I try to create an object like this:
var category = new webshop.classes.business.Category("1");
This calls the second constructor, although I use only one parameter. What's
wrong? Is it not possible to use two constructors? Didn't find an example
for this.
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/Two-or-more-constructors-tp7219626p7219626.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel