On Fri, Nov 27, 2009 at 13:31, Jean-Noël Rivasseau <[email protected]>wrote:
> Hi Derell, thanks for the reply.
>
> That's an interesting way you suggest, unfortunately it won't be enough in
> my case, as I have methods that have the same name as those of the base
> class (eg, I am overriding them). So a Mixin wont be allright.
>
> Any more ideas?
>
If you really, really know what you're doing and it's ok to override those
methods for ALL uses of the class, then you can use qx.Class.patch ()
instead of qx.Class.include(). This will allow you to override methods of
the original class, effectively modifying the original class at run-time. If
you do this, you need to know that nothing else, e.g. as used by the
framework, depends on the original behavior.
Derrell
> Jean-Noel
>
>
> This is interesting. I _think_ you should be able to do it with a mixin,
>> but I have a feeling that the generator is going to mess with variable
>> obscuration too early for it to take effect. Hopefully I'm wrong. Give the
>> following untested code a try. Create a mixin and add your addSpecial method
>> to TabView rather than extending TabView with your own class.
>>
>> qx.Mixin.define("custom.MTabView",
>> {
>> methods :
>> {
>> addSpecial : function(page, right)
>> {
>> ...
>> }
>> }
>> });
>>
>> Then in your application, include this mixin before your first use of
>> TabView:
>>
>> qx.Class.include(qx.ui.tabview.TabView, custom.MTabView);
>>
>> Now every time you instantiate a qx.ui.tabview.TabView object, it will
>> have the addSpecial() method too.
>>
>> Good luck! :-)
>>
>> Derrell
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and focus
>> on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel