remoteobject 返回结果绑定 50
packagecom{//importmx.collections.ArrayCollection;importmx.controls.Alert;importmx.me...
package com
{
//import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.Operation;
import mx.rpc.remoting.RemoteObject;
public class Tomcat
{
const ENDPOINT : String = "http://localhost:8080/java_serves/messagebroker/amf";
var ro : RemoteObject;
[bindable]
public var arrC:ArrayCollection;
public function tomcat()
{
ro = new RemoteObject();
ro.destination = "server";
var c : AMFChannel = new AMFChannel("my-amf", ENDPOINT);
var cs : ChannelSet = new ChannelSet();
cs.addChannel(c);
ro.channelSet = cs;
}
public function isUserValid(username:Object):void
{
var op : Operation = Operation(ro.getOperation("SayHello"));
op.addEventListener(ResultEvent.RESULT, result);
op.addEventListener(FaultEvent.FAULT, fault);
op.send(username);
}
public function result(event:ResultEvent):void {
Alert.show(event.result.toString());
}
public function fault(event:FaultEvent):void {
//Alert.show(event.fault.toString());
}
}
}
remoteobject 返回结果能打印出来 这个类没有和mxml混写在一起
问怎样把event.result 绑定到DataGrid
知道解决的附上代码片段或者+27425327 展开
{
//import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.messaging.ChannelSet;
import mx.messaging.channels.AMFChannel;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.remoting.Operation;
import mx.rpc.remoting.RemoteObject;
public class Tomcat
{
const ENDPOINT : String = "http://localhost:8080/java_serves/messagebroker/amf";
var ro : RemoteObject;
[bindable]
public var arrC:ArrayCollection;
public function tomcat()
{
ro = new RemoteObject();
ro.destination = "server";
var c : AMFChannel = new AMFChannel("my-amf", ENDPOINT);
var cs : ChannelSet = new ChannelSet();
cs.addChannel(c);
ro.channelSet = cs;
}
public function isUserValid(username:Object):void
{
var op : Operation = Operation(ro.getOperation("SayHello"));
op.addEventListener(ResultEvent.RESULT, result);
op.addEventListener(FaultEvent.FAULT, fault);
op.send(username);
}
public function result(event:ResultEvent):void {
Alert.show(event.result.toString());
}
public function fault(event:FaultEvent):void {
//Alert.show(event.fault.toString());
}
}
}
remoteobject 返回结果能打印出来 这个类没有和mxml混写在一起
问怎样把event.result 绑定到DataGrid
知道解决的附上代码片段或者+27425327 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询