webgui/www/extras/yui-ext/docs/output/YAHOO.widget.DS_XHR.html
JT Smith cfd09a5cb6 upgraded to yui 0.12.0
upgraded to yui-ext 0.33 rc2
2006-11-28 02:23:34 +00:00

652 lines
No EOL
38 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YAHOO.widget.DS_XHR</title>
<link rel="stylesheet" type="text/css" href="../resources/reset.css"/>
<link rel="stylesheet" type="text/css" href="../resources/style.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="../resources/print.css" media="print">
</head>
<body>
<div class="body-wrap">
<div class="top-tools"><img src="../resources/print.gif" width="16" height="16" align="absmiddle">&nbsp;<a href="YAHOO.widget.DS_XHR.html" target="_blank">Print Friendly</a></div>
<h1>Class YAHOO.widget.DS_XHR</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td>YAHOO.widget</td></tr>
<tr><td class="label">Class:</td><td>DS_XHR</td></tr>
<tr><td class="label">Extends:</td><td><a href="YAHOO.widget.DataSource.html">DataSource</a></td></tr>
<tr><td class="label">Defined In:</td><td><a href="autocomplete.js.html">autocomplete.js</a></td></tr>
</table>
<div class="description">
Implementation of YAHOO.widget.DataSource using XML HTTP requests that return
query results. </div>
<hr />
<a name="properties"></a>
<h2>Public Properties</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Property</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#ERROR_DATANULL">ERROR_DATANULL</a> : String</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#ERROR_DATANULL">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">&lt;static&gt; Error message for null data responses.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#ERROR_DATAPARSE">ERROR_DATAPARSE</a> : String</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#ERROR_DATAPARSE">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">&lt;static&gt; Error message for data responses with parsing errors.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#ERROR_DATAXHR">ERROR_DATAXHR</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">&lt;static&gt; Error message for XHR failure.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#TYPE_FLAT">TYPE_FLAT</a> : Number</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">&lt;static&gt; Flat-file data type.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#TYPE_JSON">TYPE_JSON</a> : Number</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">&lt;static&gt; JSON data type.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#TYPE_XML">TYPE_XML</a> : Number</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">&lt;static&gt; XML data type.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#connMgr">connMgr</a> : Object</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">Alias to YUI Connection Manager. Allows implementers to specify their own
subclasses of the YUI Connection Manager ut...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#connTimeout">connTimeout</a> : Number</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">Number of milliseconds the XHR connection will wait for a server response. A
a value of zero indicates the XHR connec...</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#maxCacheEntries">maxCacheEntries</a> : Number</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#maxCacheEntries">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Max size of the local cache. Set to 0 to turn off caching. Caching is
useful to reduce the number of server connect...</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#queryMatchCase">queryMatchCase</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#queryMatchCase">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Enables query case-sensitivity matching. If caching is on and
queryMatchCase is true, queries will only return result...</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#queryMatchContains">queryMatchContains</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#queryMatchContains">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Use this to equate cache matching with the type of matching done by your live
data source. If caching is on and query...</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#queryMatchSubset">queryMatchSubset</a> : Boolean</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#queryMatchSubset">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Enables query subset matching. If caching is on and queryMatchSubset is
true, substrings of queries will return match...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#responseStripAfter">responseStripAfter</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">String after which to strip results. If the results from the XHR are sent
back as HTML, the gzip HTML comment appears...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#responseType">responseType</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML
and YAHOO.widget.DS_XHR.TYPE...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#scriptQueryAppend">scriptQueryAppend</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">String of key/value pairs to append to requests made to scriptURI. Define
this string when you want to send additiona...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#scriptQueryParam">scriptQueryParam</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">Query string parameter name sent to scriptURI. For instance, queries will be
sent to &#60;scriptURI&#62;?&#60;scriptQ...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#scriptURI">scriptURI</a> : String</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">Absolute or relative URI to script that returns query results. For instance,
queries will be sent to &#60;scriptURI&#...</td>
</tr>
</table>
<a name="methods"></a>
<h2>Public Methods</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Method</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#DS_XHR">DS_XHR</a>(<code>sScriptURI {String}</code>, <code>aSchema {String[]}</code>, <span class="optional" title="Optional">[<code>oConfigs {Object}</code>]</span>)</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc"></td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#doQuery">doQuery</a>(<code>oCallbackFn {HTMLFunction}</code>, <code>sQuery {String}</code>, <code>oParent {Object}</code>) : void</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr class="alt">
<td class="mdesc">Queries the live data source defined by scriptURI for results. Results are
passed back to a callback function.</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#flushCache">flushCache</a>() : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#flushCache">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Flushes cache.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getResults">getResults</a>(<code>oCallbackFn {HTMLFunction}</code>, <code>sQuery {String}</code>, <code>oParent {Object}</code>) : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#getResults">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Retrieves query results, first checking the local cache, then making the
query request to the live data source as def...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#parseResponse">parseResponse</a>(<code>sQuery {String}</code>, <code>oResponse {Object}</code>, <code>oParent {Object}</code>) : s</td>
<td class="msource" rowspan="2">DS_XHR</td>
</tr>
<tr>
<td class="mdesc">Parses raw response data into an array of result objects. The result data key
is always stashed in the [0] element of...</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#toString">toString</a>() : String</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#toString">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Public accessor to the unique name of the DataSource instance.</td>
</tr>
</table>
<a name="events"></a>
<h2>Public Events</h2>
<table cellspacing="0" class="member-table">
<tr>
<th class="sig-header" colspan="2">Event</th>
<th class="msource-header">Defined By</th>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-cacheFlushEvent">cacheFlushEvent</a> : (<code>oSelf {Object}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-cacheFlushEvent">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Fired when the local cache is flushed.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-cacheQueryEvent">cacheQueryEvent</a> : (<code>oSelf {Object}</code>, <code>oParent {Object}</code>, <code>sQuery {String}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-cacheQueryEvent">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fired when a query is made to the local cache.</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-dataErrorEvent">dataErrorEvent</a> : (<code>oSelf {Object}</code>, <code>oParent {Object}</code>, <code>sQuery {String}</code>, <code>sMsg {String}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-dataErrorEvent">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Fired when an error is encountered with the live data source.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-getCachedResultsEvent">getCachedResultsEvent</a> : (<code>oSelf {Object}</code>, <code>oParent {Object}</code>, <code>sQuery {String}</code>, <code>aResults {Object[]}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-getCachedResultsEvent">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fired when data is retrieved from the local cache.</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-getResultsEvent">getResultsEvent</a> : (<code>oSelf {Object}</code>, <code>oParent {Object}</code>, <code>sQuery {String}</code>, <code>aResults {Object[]}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-getResultsEvent">DataSource</a></td>
</tr>
<tr>
<td class="mdesc">Fired when data is retrieved from the live data source.</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-queryEvent">queryEvent</a> : (<code>oSelf {Object}</code>, <code>oParent {Object}</code>, <code>sQuery {String}</code>)</td>
<td class="msource" rowspan="2"><a href="YAHOO.widget.DataSource.html#event-queryEvent">DataSource</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Fired when a query is made to the live data source.</td>
</tr>
</table>
<h2 class="mdetail-head">Property Details</h2>
<div class="detail-wrap">
<a name="ERROR_DATANULL"></a>
<div class="mdetail">
<h3>ERROR_DATANULL</i></h3>
<code>public String ERROR_DATANULL</code>
<div class="mdetail-desc">
&lt;static&gt; Error message for null data responses. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#ERROR_DATANULL">DataSource</a>.</div>
</div>
<a name="ERROR_DATAPARSE"></a>
<div class="mdetail alt">
<h3>ERROR_DATAPARSE</i></h3>
<code>public String ERROR_DATAPARSE</code>
<div class="mdetail-desc">
&lt;static&gt; Error message for data responses with parsing errors. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#ERROR_DATAPARSE">DataSource</a>.</div>
</div>
<a name="ERROR_DATAXHR"></a>
<div class="mdetail">
<h3>ERROR_DATAXHR</i></h3>
<code>public String ERROR_DATAXHR</code>
<div class="mdetail-desc">
&lt;static&gt; Error message for XHR failure. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="TYPE_FLAT"></a>
<div class="mdetail alt">
<h3>TYPE_FLAT</i></h3>
<code>public Number TYPE_FLAT</code>
<div class="mdetail-desc">
&lt;static&gt; Flat-file data type. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="TYPE_JSON"></a>
<div class="mdetail">
<h3>TYPE_JSON</i></h3>
<code>public Number TYPE_JSON</code>
<div class="mdetail-desc">
&lt;static&gt; JSON data type. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="TYPE_XML"></a>
<div class="mdetail alt">
<h3>TYPE_XML</i></h3>
<code>public Number TYPE_XML</code>
<div class="mdetail-desc">
&lt;static&gt; XML data type. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="connMgr"></a>
<div class="mdetail">
<h3>connMgr</i></h3>
<code>public Object connMgr</code>
<div class="mdetail-desc">
Alias to YUI Connection Manager. Allows implementers to specify their own
subclasses of the YUI Connection Manager utility. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="connTimeout"></a>
<div class="mdetail alt">
<h3>connTimeout</i></h3>
<code>public Number connTimeout</code>
<div class="mdetail-desc">
Number of milliseconds the XHR connection will wait for a server response. A
a value of zero indicates the XHR connection will wait forever. Any value
greater than zero will use the Connection utility's Auto-Abort feature. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="maxCacheEntries"></a>
<div class="mdetail">
<h3>maxCacheEntries</i></h3>
<code>public Number maxCacheEntries</code>
<div class="mdetail-desc">
Max size of the local cache. Set to 0 to turn off caching. Caching is
useful to reduce the number of server connections. Recommended only for data
sources that return comprehensive results for queries or when stale data is
not an issue. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#maxCacheEntries">DataSource</a>.</div>
</div>
<a name="queryMatchCase"></a>
<div class="mdetail alt">
<h3>queryMatchCase</i></h3>
<code>public Boolean queryMatchCase</code>
<div class="mdetail-desc">
Enables query case-sensitivity matching. If caching is on and
queryMatchCase is true, queries will only return results for case-sensitive
matches. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#queryMatchCase">DataSource</a>.</div>
</div>
<a name="queryMatchContains"></a>
<div class="mdetail">
<h3>queryMatchContains</i></h3>
<code>public Boolean queryMatchContains</code>
<div class="mdetail-desc">
Use this to equate cache matching with the type of matching done by your live
data source. If caching is on and queryMatchContains is true, the cache
returns results that "contain" the query string. By default,
queryMatchContains is set to false, meaning the cache only returns results
that "start with" the query string. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#queryMatchContains">DataSource</a>.</div>
</div>
<a name="queryMatchSubset"></a>
<div class="mdetail alt">
<h3>queryMatchSubset</i></h3>
<code>public Boolean queryMatchSubset</code>
<div class="mdetail-desc">
Enables query subset matching. If caching is on and queryMatchSubset is
true, substrings of queries will return matching cached results. For
instance, if the first query is for "abc" susequent queries that start with
"abc", like "abcd", will be queried against the cache, and not the live data
source. Recommended only for DataSources that return comprehensive results
for queries with very few characters. </div>
<div class="mdetail-def">This property is defined by <a href="YAHOO.widget.DataSource.html#queryMatchSubset">DataSource</a>.</div>
</div>
<a name="responseStripAfter"></a>
<div class="mdetail">
<h3>responseStripAfter</i></h3>
<code>public String responseStripAfter</code>
<div class="mdetail-desc">
String after which to strip results. If the results from the XHR are sent
back as HTML, the gzip HTML comment appears at the end of the data and should
be ignored. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="responseType"></a>
<div class="mdetail alt">
<h3>responseType</i></h3>
<code>public String responseType</code>
<div class="mdetail-desc">
XHR response data type. Other types that may be defined are YAHOO.widget.DS_XHR.TYPE_XML
and YAHOO.widget.DS_XHR.TYPE_FLAT. </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="scriptQueryAppend"></a>
<div class="mdetail">
<h3>scriptQueryAppend</i></h3>
<code>public String scriptQueryAppend</code>
<div class="mdetail-desc">
String of key/value pairs to append to requests made to scriptURI. Define
this string when you want to send additional query parameters to your script.
When defined, queries will be sent to
&#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput&#38;&#60;scriptQueryAppend&#62; </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="scriptQueryParam"></a>
<div class="mdetail alt">
<h3>scriptQueryParam</i></h3>
<code>public String scriptQueryParam</code>
<div class="mdetail-desc">
Query string parameter name sent to scriptURI. For instance, queries will be
sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
<a name="scriptURI"></a>
<div class="mdetail">
<h3>scriptURI</i></h3>
<code>public String scriptURI</code>
<div class="mdetail-desc">
Absolute or relative URI to script that returns query results. For instance,
queries will be sent to &#60;scriptURI&#62;?&#60;scriptQueryParam&#62;=userinput </div>
<div class="mdetail-def">This property is defined by DS_XHR.</div>
</div>
</div>
<a name="DS_XHR"></a>
<h2 class="mdetail-head">Constructor Details</h2>
<div class="detail-wrap">
<div class="mdetail">
<h3>DS_XHR</i></h3>
<code>public function DS_XHR(<code>sScriptURI {String}</code>, <code>aSchema {String[]}</code>, <span class="optional" title="Optional">[<code>oConfigs {Object}</code>]</span>)</code>
<div class="mdetail-desc">
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>{String}</code> : sScriptURI<div class="sub-desc">Absolute or relative URI to script that returns query results as JSON, XML, or delimited flat-file data.</div></li><li><code>{String[]}</code> : aSchema<div class="sub-desc">Data schema definition of results.</div></li><li><code>{Object}</code> : oConfigs<div class="sub-desc">(optional) Object literal of config params.</div></li> </ul>
</div>
</div>
</div>
</div>
<h2 class="mdetail-head">Method Details</h2>
<div class="detail-wrap">
<a name="doQuery"></a>
<div class="mdetail">
<h3>doQuery</i></h3>
<code>public function doQuery(<code>oCallbackFn {HTMLFunction}</code>, <code>sQuery {String}</code>, <code>oParent {Object}</code>)</code>
<div class="mdetail-desc">
Queries the live data source defined by scriptURI for results. Results are
passed back to a callback function.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>{HTMLFunction}</code> : oCallbackFn<div class="sub-desc">Callback function defined by oParent object to which to return results.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">Query string.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The object instance that has requested data.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DS_XHR.</div>
</div>
<a name="flushCache"></a>
<div class="mdetail alt">
<h3>flushCache</i></h3>
<code>public function flushCache()</code>
<div class="mdetail-desc">
Flushes cache.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.widget.DataSource.html#flushCache">DataSource</a>.</div>
</div>
<a name="getResults"></a>
<div class="mdetail">
<h3>getResults</i></h3>
<code>public function getResults(<code>oCallbackFn {HTMLFunction}</code>, <code>sQuery {String}</code>, <code>oParent {Object}</code>)</code>
<div class="mdetail-desc">
Retrieves query results, first checking the local cache, then making the
query request to the live data source as defined by the function doQuery.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>{HTMLFunction}</code> : oCallbackFn<div class="sub-desc">Callback function defined by oParent object to which to return results.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">Query string.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The object instance that has requested data.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.widget.DataSource.html#getResults">DataSource</a>.</div>
</div>
<a name="parseResponse"></a>
<div class="mdetail alt">
<h3>parseResponse</i></h3>
<code>public function parseResponse(<code>sQuery {String}</code>, <code>oResponse {Object}</code>, <code>oParent {Object}</code>)</code>
<div class="mdetail-desc">
Parses raw response data into an array of result objects. The result data key
is always stashed in the [0] element of each result object.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>{String}</code> : sQuery<div class="sub-desc">Query string.</div></li><li><code>{Object}</code> : oResponse<div class="sub-desc">The raw response data to parse.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The object instance that has requested data.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>s</code><div class="sub-desc">{Object[]} Array of result objects.</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by DS_XHR.</div>
</div>
<a name="toString"></a>
<div class="mdetail">
<h3>toString</i></h3>
<code>public function toString()</code>
<div class="mdetail-desc">
Public accessor to the unique name of the DataSource instance.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>String</code><div class="sub-desc">Unique name of the DataSource instance</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.widget.DataSource.html#toString">DataSource</a>.</div>
</div>
</div>
<h2 class="mdetail-head">Event Details</h2>
<div class="detail-wrap">
<a name="event-cacheFlushEvent"></a>
<div class="mdetail">
<h3>cacheFlushEvent</i></h3>
<code>public event cacheFlushEvent</code>
<div class="mdetail-desc">
Fired when the local cache is flushed.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-cacheFlushEvent">DataSource</a>.</div>
</div>
<a name="event-cacheQueryEvent"></a>
<div class="mdetail alt">
<h3>cacheQueryEvent</i></h3>
<code>public event cacheQueryEvent</code>
<div class="mdetail-desc">
Fired when a query is made to the local cache.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The requesting object.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">The query string.</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-cacheQueryEvent">DataSource</a>.</div>
</div>
<a name="event-dataErrorEvent"></a>
<div class="mdetail">
<h3>dataErrorEvent</i></h3>
<code>public event dataErrorEvent</code>
<div class="mdetail-desc">
Fired when an error is encountered with the live data source.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The requesting object.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">The query string.</div></li><li><code>{String}</code> : sMsg<div class="sub-desc">Error message string</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-dataErrorEvent">DataSource</a>.</div>
</div>
<a name="event-getCachedResultsEvent"></a>
<div class="mdetail alt">
<h3>getCachedResultsEvent</i></h3>
<code>public event getCachedResultsEvent</code>
<div class="mdetail-desc">
Fired when data is retrieved from the local cache.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The requesting object.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">The query string.</div></li><li><code>{Object[]}</code> : aResults<div class="sub-desc">Array of result objects.</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-getCachedResultsEvent">DataSource</a>.</div>
</div>
<a name="event-getResultsEvent"></a>
<div class="mdetail">
<h3>getResultsEvent</i></h3>
<code>public event getResultsEvent</code>
<div class="mdetail-desc">
Fired when data is retrieved from the live data source.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The requesting object.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">The query string.</div></li><li><code>{Object[]}</code> : aResults<div class="sub-desc">Array of result objects.</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-getResultsEvent">DataSource</a>.</div>
</div>
<a name="event-queryEvent"></a>
<div class="mdetail alt">
<h3>queryEvent</i></h3>
<code>public event queryEvent</code>
<div class="mdetail-desc">
Fired when a query is made to the live data source.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>{Object}</code> : oSelf<div class="sub-desc">The DataSource instance.</div></li><li><code>{Object}</code> : oParent<div class="sub-desc">The requesting object.</div></li><li><code>{String}</code> : sQuery<div class="sub-desc">The query string.</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by <a href="YAHOO.widget.DataSource.html#event-queryEvent">DataSource</a>.</div>
</div>
</div>
</div>
<hr>
Copyright &copy; 2006 Jack Slocum. All rights reserved.
</body>
</html>