Sumit_Tyagi
Enthusiast
Enthusiast

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

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

0 Kudos
0 Replies