can you just recall BindingUtils.bindProperty(txtDemo, "text", 
xml, "label"); in your click function?

--- In [email protected], "xyjaws" <[EMAIL PROTECTED]> wrote:
>
> The question is: Howto dynamicly bind XML element to a TextInput 
> component using BindingUtils?
> 
> Now I use following codes:
> <!--
> [Bindable] private var xml: XML = <item><label>list1</label></item>;
> 
> // initialize code for application's initialize event
> private function init(): void {
> BindingUtils.bindProperty(txtDemo, "text", xml, "label");
> }
> 
> //click event
> private function test(): void {
> xml.label = "something";
BindingUtils.bindProperty(txtDemo, "text", xml, "label");
> // txtDemo.executeBindings(); //---- no use anymore
> }
> -->
> <mx:TextInput id="txtDemo"/>
> <mx:Button label="Test" click="test()"/>
> 
> //--------------------------------------
> My really idea is when bindable xml property is changed, then the 
> textinput will be updated as hoped. However, no update happens to 
me 
> when I click the Test button.
> 
> But, if I make codes like that:
> <mx: TextInput id="txtDemo" text="{xml.label}"/>
> the text will updated when xml changs.
> 
> So, what happened, I indeed need the dynamicly bind to the 
textinput 
> compont.
> Help me. thanks.
>


Reply via email to