bhuvana
bhuvana

Reputation: 31

how to display XML format data in TextArea in flex

I am having a function returning an XML tree structure , I wish to display the whole tree in an TextArea in flex. Here is the code:

    <mx:Button id="button1" label="Submit" width="100" click="mainTxt.text=myemp.input_data(args);" />

input_data() returns XML tree .How do I send it to mainTxt TextArea ? I have tried using mainTxt.html as well.

-BHU

Upvotes: 0

Views: 689

Answers (1)

JK Patel
JK Patel

Reputation: 858

<fx:Script>
    <![CDATA[
    protected function onButton1ClickHandler(event:MouseEVent):void
    {
        trace(myemp.input_data(args));
        var xmlStr:XML = myemp.input_data(args);
        mainTxt.text = xmlStr.toString();
    }    
]]>
</fx:Script>

<mx:Button id="button1"
           label="Submit"
           width="100"
           click="onButton1ClickHandler(event)" />

first check this trace() if this will print correct XML-tree then you have answer.

May this will help...

Upvotes: 1

Related Questions