Convert returning value from RemoteObject to ArrayCollection : RemoteObject « Development « Flex






Convert returning value from RemoteObject to ArrayCollection

Convert returning value from RemoteObject to ArrayCollection
        

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" verticalGap="10">
  <mx:Script>
    
    import mx.utils.ArrayUtil;
  </mx:Script>
  <mx:RemoteObject id="employeeRO" destination="roDest" showBusyCursor="true" fault="mx.controls.Alert.show(event.fault.faultString, 'Error');">
    <mx:method name="getList">
      <mx:arguments>
        <deptId>{dept.selectedItem.data}</deptId>
      </mx:arguments>
    </mx:method>
  </mx:RemoteObject>
  <mx:ArrayCollection id="employeeAC" source="{ArrayUtil.toArray(employeeRO.getList.lastResult)}" />
  <mx:HBox>
    <mx:ComboBox id="dept" width="150">
      <mx:dataProvider>
        <mx:ArrayCollection>
          <mx:source>
            <mx:Object label="A" data="A param" />
            <mx:Object label="B" data="B param" />
            <mx:Object label="C" data="c param" />
          </mx:source>
        </mx:ArrayCollection>
      </mx:dataProvider>
    </mx:ComboBox>
    <mx:Button label="Get" click="employeeRO.getList.send()" />
  </mx:HBox>
  <mx:DataGrid dataProvider="{employeeAC}" width="100%">
    <mx:columns>
      <mx:DataGridColumn dataField="name" headerText="Name" />
      <mx:DataGridColumn dataField="phone" headerText="Phone" />
      <mx:DataGridColumn dataField="email" headerText="Email" />
    </mx:columns>
  </mx:DataGrid>
</mx:Application>

   
    
    
    
    
    
    
    
  








Related examples in the same category

1.Feed returning value from RemoteObject to DataGridFeed returning value from RemoteObject to DataGrid
2.Calling RemoteObject components in ActionScript
3.Call remote method with RemoteObjectCall remote method with RemoteObject
4.Pass bounded parameters to RemoteObjectPass bounded parameters to RemoteObject
5.RemoteObject Result EventRemoteObject Result Event
6.RemoteObject With BindingsRemoteObject With Bindings
7.Remote Object Explicit ArgumentsRemote Object Explicit Arguments
8.Remote Object with Multiple MethodsRemote Object with Multiple Methods