Flex HTTPService.send() 不会触发 ResultEvent
你好 我正在尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该在
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 yourHTTPService
. If there is a failure of any kind, yourfault
event handler should get called:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/rpc/http/HTTPService.html#event:fault