[英]Dynamically populating textArea in Flashbuilder
I cant seem to populate a textArea dynamically in flash builder. 我似乎无法在Flash Builder中动态填充textArea。 The only tutorials I can find are populating dataGrids or drop downs using a dataProvider.
我能找到的唯一教程是使用dataProvider填充dataGrid或下拉列表。 Heres the code I am using:
这是我正在使用的代码:
<s:HTTPService id="noteService"
url="http://localhost/webAppIntergration%20Thur/Assignment/servicePipe.php?action=getNoteXML"
/>
The HTTPService gets sent when the app is created. 创建应用程序时将发送HTTPService。 And here is the textArea code I tried:
这是我尝试过的textArea代码:
<s:TextArea text="{noteService.lastResult.notess.notes}"/>
The only thing that gets returned to the textArea is "[object Object]" so I guess I have to change it to a different type or a string before it can be output to a textArea field but i'm not 100% sure on how to do this. 返回到textArea的唯一内容是“ [object Object]”,因此我想必须将其更改为其他类型或字符串,然后才能将其输出到textArea字段,但我不确定100%如何去做这个。
Any help would be great thanks! 任何帮助将非常感谢!
You can try some thing like below code to populate dynamic string to your defined text area: - 您可以尝试执行以下代码,将动态字符串填充到您定义的文本区域中:-
<fx:Script>
<![CDATA[
import mx.rpc.events.ResultEvent;
private function resultHandler(event:ResultEvent):void
{
//parse your result or type cast.
textArea.text = noteService.lastResult.notess.notes
}
]]>
</fx:Script>
<s:TextArea id="textArea"/>
<s:HTTPService id="noteService"
url="http://localhost/webAppIntergration%20Thur/Assignment/servicePipe.php?action=getNoteXML"
result="resultHandler(event)"
fault="trace('fault')"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.