Hello Michael,

thank you for your answer. Unfortunatly that didn't help. The method 
still gets executed despite the interfaces precondition and 
hasInterface() still returns false.

Michael Helwig schrieb:
> Hey Eric,
>
> have you tried leaving the brackets "[" and "]" away in your interface 
> declaration? I'm not sure what they are there for, I have never used 
> them and my interface implementations work.
>
> Best,
>
> Michael
> Eric Brachmann schrieb:
>   
>> Hello,
>>
>> working on a project with qooxdoo I recognized, that the preconditions I 
>> set in an interface were not evaluated correctly. It seems that my 
>> classes do not implement their interfaces at all, although the code 
>> looks fine and no error is thrown.
>>
>> An example to illustrate the issue:
>>
>> IMyInterface.js:
>>  qx.Interface.define("itest.IMyInterface",
>>  {
>>    members:
>>    {
>>      testMe: function() { return false; }
>>    }
>> });
>>
>> MyClass.js
>>  qx.Class.define("itest.MyClass",
>>  {
>>    extend: qx.core.Object,
>>    implement: [itest.IMyInterface],
>>
>>    members:
>>    {
>>      testMe: function() { alert("You should not see this!"); }
>>    }
>> });
>>
>> Application.js (excerpt):
>> ...
>> var test = new itest.MyClass();
>>      
>> alert("implements interface: " 
>>     + qx.Class.implementsInterface(test, itest.IMyInterface)
>>     + ", has interface: "
>>     + qx.Class.hasInterface(test, itest.IMyInterface));
>>      
>> test.testMe();
>> ...
>>
>> The output is "implements interface:  true, has interface: false" as if 
>> the implement statement in the class definition is being ignored.
>> The testMe() method gets executed even though the precondition of the 
>> interface evaluates to false.
>>
>> A project of this simple example is avaiable here: 
>> http://www.hatter.de/studium/itest.zip
>>
>> It would be very kind if someone could enlighten me.
>>
>> Regards, eB.
>>
>>     

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT 
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian 
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to