It is possible to implement more than one interface so if you only want one, it has to be an array with one element.
Greetings, Andreas -----Ursprüngliche Nachricht----- Von: Lutz Schoder [mailto:[email protected]] Gesendet: Montag, 4. Mai 2009 11:22 An: qooxdoo Development Betreff: Re: [qooxdoo-devel] Check an object for an implemented interface Hi Andreas, I understand not why but now it works. Thanks. Lutz Fink, Andreas schrieb: > I think you should set implement as array: > > qx.Class.define("scqx.ui.form.TextField", > { > extend : qx.ui.form.TextField, > implement : [scqx.ui.form.DataComponentIf, ...] //define an array here > > > Regards, > Andreas > > -----Ursprüngliche Nachricht----- > Von: Lutz Schoder [mailto:[email protected]] > Gesendet: Montag, 4. Mai 2009 10:43 > An: qooxdoo Development > Betreff: [qooxdoo-devel] Check an object for an implemented interface > > Hi All, > > I have a problem with checking an object for implementing an interface. > I have a class which > implements an interface: > > qx.Interface.define("scqx.ui.form.DataComponentIf", > { > ... > > qx.Class.define("scqx.ui.form.TextField", > { > extend : qx.ui.form.TextField, > implement : scqx.ui.form.DataComponentIf, > ... > > Following method should only register components which implement the > interface: > > add : function(component) { > if (qx.Class.implementsInterface(component, > scqx.ui.form.DataComponentIf)) { > this.__dataComponents[this.__dataComponents.length] = > component; > } > arguments.callee.base.apply(this, arguments); > }, > > But the interface is not detected. I've also tried to get the > implemented interfaces using > qx.Class.getInterfaces() but I got an empty array as result. > > What's wrong? > > Thanks. > > Lutz > > -- Mit freundlichen Grüßen / Best regards Lutz Schoder SoftConcept GmbH Borriesstr. 35 D-32257 Bünde www.softcontract.de www.softconcept.net Amtsgericht Bad Oeynhausen, HRB 8162 Steuernummer 310/5786/0202 Geschäftsführer: Jürgen Tiemann ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------------ Register Now & Save for Velocity, the Web Performance & Operations Conference from O'Reilly Media. Velocity features a full day of expert-led, hands-on workshops and two days of sessions from industry leaders in dedicated Performance & Operations tracks. Use code vel09scf and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
