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