VMware {code} Community
amitkyad
Contributor
Contributor
Jump to solution

How to check datamodel type in data response event of DataByConstraint request in vsphere web client plugin development

Hello, I am new in vsphere web client plugin development.

I need to dispatch multiple DataByConstraintRequest (let's say of A & B Data model class) within a single action script class. But to handle data response events, we use

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

public function onVmListRetrieved(request:DataByConstraintRequest,

result:ArrayCollection):void {

// result is an ArrayCollection of MyVmData objects

}

Here how should I come to know that result variable is either for A or B Data Model class. (including the case result may be an empty array collection)

In case of DataByModel request, we have separate data response events for data model class but I couldn't find the same for DataByConstraint.

0 Kudos
1 Solution

Accepted Solutions
laurentsd
VMware Employee
VMware Employee
Jump to solution

You can set a unique requestId to each DataByConstraintRequest and check it in the response handler.  "requestId" is a field of the base class DataRequest.

View solution in original post

2 Replies
laurentsd
VMware Employee
VMware Employee
Jump to solution

You can set a unique requestId to each DataByConstraintRequest and check it in the response handler.  "requestId" is a field of the base class DataRequest.

amitkyad
Contributor
Contributor
Jump to solution

Thanks

0 Kudos