I am trying to bind from my PromptingTextInput comonent back to a data model and I am having some trouble. I tried to do it the normal way that I do it with the TextInput component and it doesn't seem to work. I set up this example to illustrate what I am talking about. Is there another way to do this?? Or is it possible to modify the PromptingTextInput to match the functionality of the TextInput? Thanks, Kevin

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
        xmlns:controls="flexlib.controls.*"
        layout="vertical"
        >
<mx:Script>
<![CDATA[

        import mx.binding.utils.*;

        // Define data binding.
                public var newContact1:Object = new Object();
                public var newContact2:Object = new Object();
                
        private function bindTest1():void{
BindingUtils.bindProperty(newContact1, 'company', company, "text");
        }
        private function bindTest2():void{
BindingUtils.bindProperty(newContact2, 'company', id_company, "text");
        }
        private function testBind1():void{
                result.text = newContact1.company;
        }
        private function testBind2():void{
                id_result.text = newContact2.company;
        }

      ]]>
    </mx:Script>

    <mx:TextInput id="company" text="" initialize="bindTest1();"/>
    <mx:TextInput id="result" text=""/>
    <mx:Button label="Submit" click="testBind1();"/>

<controls:PromptingTextInput id="id_company" prompt="Company" text="" initialize="bindTest2();"/> <controls:PromptingTextInput id="id_result" prompt="Result" text=""/>
    <mx:Button label="Submit" click="testBind2();"/>

</mx:Application>

Reply via email to