Feature requests can go to http://www.adobe.com/go/wish.

 

If you know the name of the event generated for [Bindable] you can
simply put multiple bindable statements on the fullName property:

 

[Bindable(event="firstNameChanged")]

[Bindable(event="lastNameChanged")]

Public function get fullName():String {...

 

I don't remember if we document what the event naming pattern will be.

 

Matt

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Lachlan Cotter
Sent: Monday, December 04, 2006 3:42 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Feature request: dependant bindings meta-data

 

Hi Adobe Team,

 

Is this the right forum to talk about Flex Builder features? I have
often found myself in situations where it would be very handy to say
something like this.

 

[Bindable] public var firstName:String;

[Bindable] public var lastName:String;

 

[Bindable(basedOn='firstName,lastName')]

public function get fullName ():String {

            return firstName + ' ' + lastName;

}

 

The idea being that when a binding for firstName or lastName changes,
the dependant binding fullName will also get fired. The only way I know
to do this with the current tools is:

 

private var _firstName:String;

private var _lastName:String;

 

[Bindable] public function get firstName():String {

            return _firstName;

}

 

public function set firstName(str:String):void {

            _firstName = str;

            dispatchEvent(new PropertyChangeEvent('fullNameChanged');

}

 

[Bindable] public function get lastName():String {

            return _lastName;

}

 

public function set lastName(str:String):void {

            _lastName = str;

            dispatchEvent(new PropertyChangeEvent('fullNameChanged');

}

 

[Bindable(event='fullNameChanged')]

public function get fullName ():String {

            return firstName + ' ' + lastName;

}

 

Which is obviously less expressive. It would be great to have a kind of
'based on' meta-data for bindings as in my example. Or is there a way to
do this already that I don't know about?

 

Many thanks,

Lach

 

Reply via email to