Flex HTTPService.send() 不会触发 ResultEvent

发布于 2024-10-02 13:42:48 字数 655 浏览 3 评论 0原文

你好 我正在尝试使用 flex mx:HTTPService:

<mx:HTTPService 
 id="service"
 resultFormat="text"
 result="loadJSONDataToTree(event);" 
 method="GET"
 useProxy="false"
/>

应该发送请求的代码发送一个简单的 GET 请求:

service.url = base_url + "workbench/pipeline/";
service.send();

事件处理程序:

private function loadJSONDataToTree(event: ResultEvent): void
{
    // just making sure the method is called
    var f_dp: ArrayCollection = new ArrayCollection();
    f_dp.addItem("2");
    TreeView.dataProvider = f_dp;
}

似乎调用了 send() 方法,但事件从未触发且请求未发送,因为我在服务器日志中没有看到任何请求。这种行为的原因可能是什么?

Hello
I'm trying to send a simple GET request using flex mx:HTTPService:

<mx:HTTPService 
 id="service"
 resultFormat="text"
 result="loadJSONDataToTree(event);" 
 method="GET"
 useProxy="false"
/>

Code that is supposed to send the request:

service.url = base_url + "workbench/pipeline/";
service.send();

Event handler:

private function loadJSONDataToTree(event: ResultEvent): void
{
    // just making sure the method is called
    var f_dp: ArrayCollection = new ArrayCollection();
    f_dp.addItem("2");
    TreeView.dataProvider = f_dp;
}

It appears that the send() method is called but the event is never triggered and the request is not sent, because I don't see any requests in my server log. What could be the reason of such behavior?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ゝ杯具 2024-10-09 13:42:48

您应该在 HTTPService 上连接 fault 事件。如果出现任何类型的故障,则应调用您的 fault 事件处理程序:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/HTTPService.html#event :错误

You should hook up the fault event on your HTTPService. If there is a failure of any kind, your fault event handler should get called:

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/HTTPService.html#event:fault

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文