Hello All,
I'm having some issues where a property on a custom MXML control
isn't firing to the bound parent:
Parent MXML
[Bindable] public var testPercentage:Number;
<CustomTextControl modelValue="{testPercentage}" />
Inside the CustomTextControl, which is sublcassed from TextInput I have:
[Bindable]
public function set modelValue(value:Number):void{
_modelValue = value;
this.text = numberToPercentString(value);
// the following wasn't originally here, I added it
// because I read some Blogs with potential solutions
dispatchEvent(new Event("modelValueChanged"));
}
public function get modelValue():Number
{
return _modelValue;
}
Somewhere else in the CustomTextControl, I call:
_this.modelValue = .123456
My expected behavior is that the testPercentage would be updated, but
it doesn't occur.
It seems this should be pretty straight forward, but I'm not getting
anywhere with it.
I've tried a few things, but nothing I do seems to work. I've looked
at the MXML compiler output. the Flex frameworks TextInput source
code. Afterall, I'm really trying to bind in a simialr way that text
is, except to a typed Number.
Any suggestions?
Thanks a bunch.