Quantcast
Channel: Adobe Community : Discussion List - Using Flash Builder
Viewing all articles
Browse latest Browse all 1802

Remote Call to Blazeds and displaying the result set in grid

$
0
0

Hi,

 

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

    EmployeeRuntimeRemotingDestination.java.

    -->

   

    <mx:Script>

        <![CDATA[

           

            import mx.messaging.ChannelSet;

            import mx.messaging.channels.AMFChannel;

            import mx.rpc.remoting.mxml.RemoteObject;

           

            [Bindable]

            public var srv:RemoteObject;

           

            public function initApp():void

            {

                var channel:AMFChannel = new AMFChannel("my-amf", "http://192.168.102.208:8400/policyAnalytics/messagebroker/amf");

                var channelSet:ChannelSet = new ChannelSet();

                channelSet.addChannel(channel);

                srv = new RemoteObject();

                srv.destination="runtime-policy";   

                srv.channelSet = channelSet;

                srv.PolicyApnVO.getPoliciesApn();

            }

           

        ]]>

    </mx:Script>

   

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

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

                     showDataTips="true">

            <mx:columns>

                <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"/>

            </mx:columns>

        </mx:DataGrid>

    </mx:Panel>

   

</mx:Application>


Viewing all articles
Browse latest Browse all 1802

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>