Yes binding will generate the "objectChange" when it's done
automatically, but you'd need to look at the details to figure out if
it's the right property for you.  Generally if you find yourself wanting
to handle the event it's a good idea to do the re-write yourself because
I think it's clearer what you intend to accomplish rather than relying
on code-gen.

Matt

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Aldo Bucchi
Sent: Monday, February 20, 2006 12:36 AM
To: [email protected]
Subject: [flexcoders] Implicit change events for [Bindable] properties?
and some notes on ModelLocator

Hi all,

I USUALLY FIND MYSELF REWRITING THE FOLLOWING STATEMENT

<snip>

[Bindable]
public var selectedItem:ItemVO;

</snip>

TO SOMETHING LIKE THIS

<snip>

private var __selectedItem:ItemVO;
[Bindable("selectedItemChanged")]
public function get selectedItem():ItemVO{
    return __selectedItem;
}
public function set selectedItem( v:ItemVO ):void{
    __selectedItem = v;
    dispatchEvent( new Event("selectedItemChanged") );
}
// I ommited the Event metadata of course
</snip>

SO I CAN DO THIS...

<snip>

<MyComp
selectedItemChanged="doSomethingThatCannotBeDoneThroughBinding()"/>

</snip>

is there an implicit event that is fired when a Bindable property is
changed??
I have digged a little into the generated AS and apparently the
"objectChange" event is used in general... but Is there a more
granular approach?

As a tangent to this issue.. ( now this is just in case any cairngorm
fella is reading this ), I believe that the ModelLocator should be
wrapp'able as an MXML tag to support inline event handlers... I always
do that with my model locators ( I just call them models though ).

Of course the MXML wrapper would create a new instance, which itself
would be wrapping a singleton. there are some patterns around that (
all of which involve some unwanted boiler plate code and repetition ).
I will post some more on this later perhaps. need some sleep now. good
night ;)

Best,
Aldo







--
::::: Aldo Bucchi :::::
mobile (56) 8 429 8300


--
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



 





--
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