| Package | com.vmware.data.query.events |
| Class | public class DataByConstraintRequest |
| Inheritance | DataByConstraintRequest DataRequest Request flash.events.Event |
| Property | Defined By | ||
|---|---|---|---|
| constraint : Constraint
Constraint to use to match returned server objects. | DataByConstraintRequest | ||
![]() | context : Object
Optional context that might be required to handle the response. | Request | |
| maxResultCount : Number = -1
The maximum number of results to retrieve. | DataByConstraintRequest | ||
| model : Class
Data model class defining properties to retrieve. | DataByConstraintRequest | ||
| offset : Number = 0
The offset into the result set, 1-based. | DataByConstraintRequest | ||
| order : OrderingCriteria
The criteria specifying how the results should be ordered. | DataByConstraintRequest | ||
| parameters : Object
Parameters to pass to Data Service when retrieving certain properties. | DataByConstraintRequest | ||
![]() | requestId : String | DataRequest | |
![]() | requestInfo : DataRequestInfo
Getting the data request options
| DataRequest | |
| Method | Defined By | ||
|---|---|---|---|
DataByConstraintRequest(type:String)
Constructor. | DataByConstraintRequest | ||
addPropertyParameter(property:String, parameter:Object):void
Adds a parameter to be passed to Data Service when retrieving a property
defined in the model. | DataByConstraintRequest | ||
![]() | clone():Event [override]
Creates a clone of this event. | Request | |
newInstance(constraint:Constraint, model:Class, requestInfo:DataRequestInfo = null):DataByConstraintRequest [static]
Returns a new instance. | DataByConstraintRequest | ||
| Constant | Defined By | ||
|---|---|---|---|
| REQUEST_ID : String = dataByConstraintRequest [static] | DataByConstraintRequest | ||
| RESPONSE_ID : String = dataByConstraintResponse [static] | DataByConstraintRequest | ||
| constraint | property |
public var constraint:ConstraintConstraint to use to match returned server objects.
| maxResultCount | property |
public var maxResultCount:Number = -1The maximum number of results to retrieve.
| model | property |
public var model:ClassData model class defining properties to retrieve.
| offset | property |
public var offset:Number = 0The offset into the result set, 1-based.
| order | property |
public var order:OrderingCriteriaThe criteria specifying how the results should be ordered.
| parameters | property |
public var parameters:ObjectParameters to pass to Data Service when retrieving certain properties.
Contains property-parameter values, where the property is in form of
relationship.relationship.property, and the parameter is any
Object.
See also
| DataByConstraintRequest | () | Constructor |
public function DataByConstraintRequest(type:String)Constructor.
Parameterstype:String (default = NaN) |
| addPropertyParameter | () | method |
public function addPropertyParameter(property:String, parameter:Object):voidAdds a parameter to be passed to Data Service when retrieving a property defined in the model.
The parameter can be retrieved on the Java side in the PropertySpec
associated with the query.
Parameters
property:String — The property name as defined in the model.
| |
parameter:Object — The parameter value to passed, it can be any Object but
only one parameter per property is allowed.
|
| newInstance | () | method |
public static function newInstance(constraint:Constraint, model:Class, requestInfo:DataRequestInfo = null):DataByConstraintRequestReturns a new instance.
Parameters
constraint:Constraint — Constraint to use to match returned server objects.
| |
model:Class — Data model class defining properties to retrieve.
| |
requestInfo:DataRequestInfo (default = null) — The data request options
|
DataByConstraintRequest |
| REQUEST_ID | Constant |
public static const REQUEST_ID:String = dataByConstraintRequest| RESPONSE_ID | Constant |
public static const RESPONSE_ID:String = dataByConstraintResponse
[Event(name="dataByConstraintRequest", type=...)]
public class SomeDataViewMediator extends EventDispatcher {
private function onDataRequestFromView(event:Event):void {
var constraint:Constraint =
QuerySpecUtil.createConstraintForRelationship(hostRef, "vm");
var request:DataByConstraintRequest=
new DataByConstraintRequest.newInstance(
constraint,
model);
dispatchEvent(request);
}
// Option 1 - use EventHandler for the response
[EventHandler(name="dataByConstraintResponse")]
private function onDataRetrieved(response:MultiObjectDataResponse):void {
// response.result contains VmListItemData objects
_view.vmList.dataProvider = response.result;
}
// Option 2 - use ResponseHandler for the response
[ResponseHandler(name="dataByConstraintResponse")]
public function onDataRetrieved(request:DataByConstraintRequest,
result:ArrayCollection,
error:Error):void {
// result contains VmListItemData objects
_view.vmList.dataProvider = result;
}
}