My solution until someone tells me of a better one (not to use mixins 
doesn't count).

public static var mixinModifyCall = mixinModify();

private static function mixinModify():Void
 {
  EditableForm.prototype.oldDataSelectorModelChanged = 
EditableForm.prototype.modelChanged;
  EditableForm.prototype.modelChanged = function()
  {
   this.oldDataSelectorModelChanged.apply(this, arguments);
   onModelChanged.apply(this, arguments);
  };
 }

----- Original Message ----- 
From: "JesterXL" <[EMAIL PROTECTED]>
To: "Flexcoders" <flexcoders@yahoogroups.com>
Sent: Tuesday, October 18, 2005 12:28 PM
Subject: [flexcoders] Using DataSelector


Flex 1.5: I'm trying to utilize DataSelector without extending.  However, I
am stuck on how to get a modelChanged event from the same class that
utilizes the DataSelector mixin.  In the past I have solved this by using
the mixin on a base class, and extending that.  In this case, however, I
don't want to do that because that would mean having to use DataSelector on
VBox.

I've looked into how ScrollSelectList does it, but List and others that
actually utilize the modelChange event are merely getting it from their
super-class even though that super class doesn't get it till runtime.  He
does subscribe to the modelChange event generated from the dataProvider in
his' init method, but when trying that in my class, no go.

I can get the first modelChanged event when the dataProvider is set
externally by doing the following:

addEventListener("modelChanged", Delegate.create(this, onModelChanged));

The only solution I can think of is to use composition, but it shouldn't be
this hard to subscribe to an event...

???

--JesterXL




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links









------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to