1 Reply Latest reply: Jun 25, 2013 7:22 AM by TucsonJava RSS

    Remote Call to Blazeds and displaying the result set in grid




      I want to call a remote method using Flex application from Blazeds and display the values in DataGrid. Can anyone help in this ?


      -- I am using AMFChannel

      -- The method to be called is PolicyApnVO.getPoliciesApn()

      -- Please advice any correction if required


      Here is the mxml code :


      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

                      creationComplete="initApp()" viewSourceURL="srcview/index.html">



          Simple client to demonstrate runtime configuration of destinations.

          The "runtime-employee" destination is configured in







                  import mx.messaging.ChannelSet;

                  import mx.messaging.channels.AMFChannel;

                  import mx.rpc.remoting.mxml.RemoteObject;



                  public var srv:RemoteObject;


                  public function initApp():void


                      var channel:AMFChannel = new AMFChannel("my-amf", "");

                      var channelSet:ChannelSet = new ChannelSet();


                      srv = new RemoteObject();


                      srv.channelSet = channelSet;







          <mx:Panel title="Policy Details" width="100%" height="100%">

              <mx:DataGrid width="100%" height="100%" dataProvider="{srv.PolicyApnVO.getPoliciesApn.lastResult.data.result}"



                      <mx:DataGridColumn headerText="APN Id" dataField="apnId"/>

                      <mx:DataGridColumn headerText="APN Name" dataField="apnName"/>

                      <mx:DataGridColumn headerText="Policy ID" dataField="policyId"/>

                      <mx:DataGridColumn headerText="Policy Name" dataField="policyName"/>






        • 1. Re: Remote Call to Blazeds and displaying the result set in grid
          TucsonJava Community Member

          There may be other ways to do this but here's what I would do:


          1) add a results method to the remote object:



          2) add the callback method: private function onResult(event : * = null)


                                                               if(event is


                                                                      myData =




          3) add the variable: private var myData:ArrayCollection;


          4) make the dataProvider for the grid use the my data :



          You can probably avoid all this by adjusting your dataProvider. I am just

          not sure what it would be without experimenting. But definitely not what

          you have. Maybe just {svc.result}.