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

Home
Flex
1.Chart
2.Components
3.Container
4.Data Model
5.Development
6.Effects
7.Event
8.Graphics
9.Grid
10.Style
Flex » Development » RemoteObjectScreenshots 
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
w__w__w___.j_a_v___a__2s___.__c__o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.