flex RemoteObject 中datagrid 于Java list的数据传递

本文介绍了一种使用Java实现的员工信息管理系统,包括创建员工对象、读取员工信息并将其展示到数据网格上的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

public class EmployeeInfo {
	public Employee emp = new Employee();
	public Employee em = new Employee();
	public List<Employee> list = new ArrayList<Employee>();
	
	public List<Employee> readInfo(){
		emp.setId("22222");
		emp.setName("aaaa");
		emp.setGender("Fmale");
		emp.setEmail("asdf@adf");
		emp.setPhone("7654321");
		list.add(emp);
		list.add(em);
		return list;
	}
Employee为自己定义的一个类。


Remoting-config 配置
<destination id="EmployeeInfoRemoting">
	 <properties> 
		 <source>com.EmployeeInfo</source> 
	 </properties> 
	</destination>


<mx:Button y="10" label="Query" id="queryBtn" horizontalCenter="303" click="showEmployees()"/>
<mx:DataGrid y="156" width="674" height="357" horizontalCenter="0" id="dg">
<mx:columns>
<mx:DataGridColumn headerText="Select" itemRenderer="object.MyCheckBox" headerRenderer="mx.controls.CheckBox"/>
<mx:DataGridColumn headerText="ID" dataField="id"/>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="Gender" dataField="gender"/>
<mx:DataGridColumn headerText="Email" dataField="email"/>
<mx:DataGridColumn headerText="Phone Number" dataField="phone"/>
</mx:columns>
</mx:DataGrid>

<mx:RemoteObject destination="EmployeeInfoRemoting" id="emInfo"
result="dataInit(event)"
endpoint="http://localhost:8080/MyTest/messagebroker/amf">		
</mx:RemoteObject>

private function dataInit(event:ResultEvent):void{
			dg.dataProvider = event.result;
}
private function showEmployees():void{ 
			emInfo.readInfo();
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值