Yahoo! UI Library

DataSource Utility  2.7.0

Yahoo! UI Library > datasource > YAHOO.util.XHRDataSource
Search:
 
Filters

Class YAHOO.util.XHRDataSource - extends YAHOO.util.DataSourceBase

XHRDataSource class for accessing remote data via the YUI Connection Manager Utility

Constructor

YAHOO.util.XHRDataSource ( oLiveData , oConfigs )
Parameters:
oLiveData <HTMLElement> Pointer to live data.
oConfigs <object> (optional) Object literal of configuration values.

Properties

_xhrCallback - private object

Define Connection Manager callback object

connMethodPost - Boolean

True if data is to be sent via POST. By default, data will be sent via GET.
Default Value: false

connMgr - Object

Alias to YUI Connection Manager, to allow implementers to use a custom class.
Default Value: YAHOO.util.Connect

connTimeout - Number

The connection timeout defines how many milliseconds the XHR connection will wait for a server response. Any non-zero value will enable the Connection Manager's Auto-Abort feature.
Default Value: 0

connXhrMode - String

Defines request/response management in the following manner:
queueRequests
If a request is already in progress, wait until response is returned before sending the next request.
cancelStaleRequests
If a request is already in progress, cancel it before sending the next request.
ignoreStaleResponses
Send all requests, but handle only the response for the most recently sent request.
allowAll
Send all requests and handle all responses.
Default Value: "allowAll"

Methods

_xhrFailure

private void _xhrFailure ( oResponse )
Define Connection Manager failure handler
Parameters:
oResponse <Object> HTTPXMLRequest object
Returns: void

_xhrSuccess

private void _xhrSuccess ( oResponse )
Define Connection Manager success handler
Parameters:
oResponse <Object> HTTPXMLRequest object
Returns: void

makeConnection

Number makeConnection ( oRequest , oCallback , oCaller )
Overriding method passes query to Connection Manager. The returned response is then forwarded to the handleResponse function.
Parameters:
oRequest <Object> Request object.
oCallback <Object> Callback object literal.
oCaller <Object> (deprecated) Use oCallback.scope.
Returns: Number
Transaction ID.


Copyright © 2009 Yahoo! Inc. All rights reserved.