Hello Marc,
thats looking like a good and transparent solution in deed. Didn't see anything 
that is obviously not working or not the "qooxdoo way". ;)
Best,
Martin


Am 03.05.2011 um 17:17 schrieb Marc Puts:

> Answering my own question.
> I managed to fix it in a transparent way. It turned out to be rather 
> simple after all.
> 
> Just in case anyone searches for this issue in the future, here's what I 
> did:
> 
> 
> qx.Class.define("MyElement",
>   extend : qx.html.Element,
> 
>   members : {
> 
>     addListener : function(type, listener, self, capture) {
>       if (this.$$disposed) {
>         return null;
>       }
> 
>       if (qx.bom.Event.supportsEvent(this.getDomElement(), type)) {
>         //attach listener to native event
>         return this.base(arguments, type, listener, self, capture);
>       }
>       else {
>         //attach listener to qooxdoo event
>         return qx.event.Registration.addListener(this, type, listener, 
> self, capture);
>       }
>     },
> 
>     removeListener: function(type, listener, self, capture) {
>       if (this.$$disposed) {
>         return null;
>       }
> 
>       if (qx.bom.Event.supportsEvent(this.getDomElement(), type)) {
>         //remove listener from native event
>         return this.base(arguments, type, listener, self, capture);
>       }
>       else {
>         //remove listener from qooxdoo event
>         return qx.event.Registration.removeListener(this, type, 
> listener, self, capture);
>       }
>     },
> 
>     removeListenerById: function(id) {
>       if (this.$$disposed) {
>         return null;
>       }
> 
>       //get event type from listener id
>       var type = id.split("|")[0];
> 
>       if (qx.bom.Event.supportsEvent(this.getDomElement(), type)) {
>         //remove listener from native event
>         return this.base(arguments, id);
>       }
>       else {
>         //remove listener from qooxdoo event
>         return qx.event.Registration.removeListenerById(this, id);
>       }
>     }
>   }
> });
> 
> 
> Regards,
> Marc
> 
> 
> 
> On 05/02/2011 04:52 PM, Marc Puts wrote:
>> Hello everyone,
>> I hope you all had some nice Easter holidays. :)
>> 
>> I'm hoping someone could help me on the post quoted below (submitted
>> last Friday), since I'm still trying to find the right solution. :)
>> 
>> Regards,
>> Marc
>> 
>> 
>> On 04/29/2011 03:37 PM, Marc Puts wrote:
>>> In the SVG contrib, I have many classes that extend qx.html.Element. Most of
>>> these also define new events (sometimes explicitly, sometimes as property
>>> events). The problem is, that a qx.html.Element will not fire any events
>>> except for the native events from the DOM element.
>>> 
>>> The cause of this is that qx.html.Element overrides the addListener method
>>> of qx.core.Object, so that all events are mapped directly to the DOM
>>> element. Unfortunately, this suppresses the framework's event system.
>>> 
>>> Playground example: http://tinyurl.com/66hcyp7
>>> In the example, you need to change "extend: qx.html.Element" to "extend:
>>> qx.core.Object" to make it work.
>>> 
>>> 
>>> I'm looking for a feasible workaround for this limitation; so I can mix
>>> qooxdoo events and native events within qx.html.Element subclasses.
>>> 
>>> One way would be to add a addEventListener method to my classes, which mimic
>>> the addListener method of qx.core.Object. However, this could cause
>>> confusion for the user, who probably won't know when to use addListener and
>>> when to use addEventListener.
>>> 
>>> I'm hoping someone could suggest a better approach to this. :)
>> 
> 
> 
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network 
> management toolset available today.  Delivers lowest initial 
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to