【问题标题】:Dynamically populating textArea in Flashbuilder在 Flashbuilder 中动态填充 textArea
【发布时间】:2012-04-27 22:09:43
【问题描述】:

我似乎无法在 flash builder 中动态填充 textArea。我能找到的唯一教程是使用 dataProvider 填充 dataGrids 或下拉列表。这是我正在使用的代码:

<s:HTTPService id="noteService"
                   url="http://localhost/webAppIntergration%20Thur/Assignment/servicePipe.php?action=getNoteXML"
                   />

在创建应用程序时发送 HTTPService。这是我尝试过的 textArea 代码:

<s:TextArea text="{noteService.lastResult.notess.notes}"/>

返回到 textArea 的唯一内容是“[object Object]”,所以我想我必须先将其更改为不同的类型或字符串,然后才能将其输出到 textArea 字段,但我不是 100%确定如何做到这一点。

任何帮助将非常感谢!

【问题讨论】:

    标签: php sql apache-flex textarea flash-builder


    【解决方案1】:

    您可以尝试以下代码来将动态字符串填充到您定义的文本区域:-

    <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')"/>
    

    【讨论】:

    • 非常感谢您的回复!我确实尝试过这种方法,但您的回答让我对此进行了更多思考,我意识到我需要包含第三个 XML 节点,如下所示:“noteService.lastResult.notess.notes.note”。我以前从未这样尝试过,因为它在没有定义第三个节点的情况下很好地输出到 dataGrid,因此我认为这是类型错误。但是,是的,感谢您的帮助!
    猜你喜欢
    • 2012-11-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-14
    • 1970-01-01
    • 2017-10-08
    • 1970-01-01
    相关资源
    最近更新 更多