Quantcast
Channel: VMware Communities : Discussion List - vSphere Client SDK
Viewing all articles
Browse latest Browse all 2218

Is it possible to receive an arraylist of an object in response method of a Dispatch Event

$
0
0

Hello,

I am new in vcenter plugin development and using following code in plugin:


function requestData():void {

    var requestInfo:DataRequestInfo = new DataRequestInfo(DataUpdateSpec.newImplicitInstance());

    dispatchEvent(DataByModelRequest.newInstance(vmRef, MyVmData, requestInfo));

}

 

[ResponseHandler(name="{com.vmware.data.query.events.DataByModelRequest.RESPONSE_ID}")]

function onData(event:DataByModelRequest, result: MyVmData):void {

    _view.vmData = result;

  _proxy.getChassisFan(_view.vmData.dn, onGetChassisFan);

}


function onGetChassisFan(event:MethodReturnEvent):void{

    for each(var  fan: EquipmentFanMap in event.result as ArrayCollection) {

          equipmentFanMap = fan;

    }

}

_proxy.getChassisFan() method is returning an arraylist of a EquipmentFanMap which is fetched in onGetChassisFan() method to get required data to be displayed in a view page. But, this method is taking too much time and eventually "channel gets disconnected before an acknowledgement is received" error appears in a dialog box.

In order to avoid it, I was planning to use DAM library to send an another DataByModelRequest instead of using _proxy.getChassisFan() to fetch an arraylist of EquipmentFanMap.

 

In samples, I have seen response of a dispatch event receives only single object and then we fetch all its properties. Is it possible to receive an arraylist of a Model Class in response method ? If yes, then how we can do it.

 

Thanks,

Sumit


Viewing all articles
Browse latest Browse all 2218

Trending Articles



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