webgui/www/extras/yui-ext/docs/output/YAHOO.ext.UpdateManager.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

801 lines
No EOL
49 KiB
HTML

<!doctype html public "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>YAHOO.ext.UpdateManager</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.ext.UpdateManager.html" target="_blank">Print Friendly</a></div>
<h1>Class YAHOO.ext.UpdateManager</h1>
<table cellspacing="0">
<tr><td class="label">Package:</td><td>YAHOO.ext</td></tr>
<tr><td class="label">Class:</td><td>UpdateManager</td></tr>
<tr><td class="label">Extends:</td><td><a href="YAHOO.ext.util.Observable.html">Observable</a></td></tr>
<tr><td class="label">Defined In:</td><td><a href="UpdateManager.js.html">UpdateManager.js</a></td></tr>
</table>
<div class="description">
Provides AJAX-style update for Element object using Yahoo
UI library YAHOO.util.Connect functionality.<br><br>
Usage:<br>
<pre><code>
// Get it from a YAHOO.ext.Element object
var el = getEl('foo');
var mgr = el.getUpdateManager();
mgr.update('http://myserver.com/index.php', 'param1=1&amp;param2=2');
...
mgr.formUpdate('myFormId', 'http://myserver.com/index.php');
<br>
// or directly (returns the same UpdateManager instance)
var mgr = new YAHOO.ext.UpdateManager('myElementId');
mgr.startAutoRefresh(60, 'http://myserver.com/index.php');
mgr.onUpdate.subscribe(myFcnNeedsToKnow);
<br>
</code></pre> </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" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#defaultUrl">defaultUrl</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Cached url to use for refreshes. Overwritten every time update() is called unless 'discardUrl' param is set to true.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#disableCaching">disableCaching</a> : Boolean</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Whether to append unique parameter on get request to disable caching (Defaults to false).</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#el">el</a> : YAHOO.ext.Element</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">The Element object</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#formUpdateDelegate">formUpdateDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Delegate for formUpdate() prebound to 'this', use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arg...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#indicatorText">indicatorText</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Text for loading indicator (Defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#loadScripts">loadScripts</a> : Number</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">True to process scripts by default (Defaults to false).</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#refreshDelegate">refreshDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Delegate for refresh() prebound to 'this', use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#renderer">renderer</a> : Object</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">The renderer for this UpdateManager. Defaults to <a href="YAHOO.ext.UpdateManager.BasicRenderer.html">YAHOO.ext.UpdateManager.BasicRenderer</a>.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#showLoadIndicator">showLoadIndicator</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Whether to show indicatorText when loading (Defaults to true).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#sslBlankUrl">sslBlankUrl</a> : String</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Blank page URL to use with SSL file uploads (Defaults to 'about:blank').</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#timeout">timeout</a> : Number</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Timeout for requests or form posts in seconds (Defaults 30 seconds).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#transaction">transaction</a> : Object</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">YAHOO.util.Connect transaction object of current executing transaction</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#updateDelegate">updateDelegate</a> : Function</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Delegate for update() prebound to 'this', use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments</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="#UpdateManager">UpdateManager</a>(<code>String/HTMLElement/YAHOO.ext.Element el</code>, <span class="optional" title="Optional">[<code>Boolean forceNew</code>]</span>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Create new UpdateManager directly.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#abort">abort</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Aborts the executing transaction</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#addListener">addListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean override</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#addListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Appends an event handler to this element</td>
</tr>
<tr class="alt">
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#delayedListener">delayedListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Number delay</code>]</span>) : Function</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#delayedListener">Observable</a></td>
</tr>
<tr class="alt">
<td class="mdesc">Appends an event handler to this element that is delayed the specified number of milliseconds.</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#fireEvent">fireEvent</a>(<code>String eventName</code>, <code>Object... args</code>) : Boolean</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#fireEvent">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Fires the specified event with the passed parameters (minus the event name).</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#formUpdate">formUpdate</a>(<code>String/HTMLElement form</code>, <span class="optional" title="Optional">[<code>String url</code>]</span>, <span class="optional" title="Optional">[<code>Boolean reset</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipar...</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#getEl">getEl</a>() : YAHOO.ext.Element</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Get the Element this UpdateManager is bound to</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#isUpdating">isUpdating</a>() : Boolean</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Returns true if an update is in progress</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#purgeListeners">purgeListeners</a>() : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#purgeListeners">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Removes all listeners for this object</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#refresh">refresh</a>(<span class="optional" title="Optional">[<code>Function callback</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately</td>
</tr>
<tr>
<td class="micon inherited" title="Inherited" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#removeListener">removeListener</a>(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>) : void</td>
<td class="msource" rowspan="2"><a href="YAHOO.ext.util.Observable.html#removeListener">Observable</a></td>
</tr>
<tr>
<td class="mdesc">Removes a listener</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setDefaultUrl">setDefaultUrl</a>(<code>String/Function defaultUrl</code>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Set the defaultUrl used for updates</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#setRenderer">setRenderer</a>(<code>Object renderer</code>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Set the content renderer for this UpdateManager. See <a href="YAHOO.ext.UpdateManager.BasicRenderer.html#render">YAHOO.ext.UpdateManager.BasicRenderer.render</a> for more details.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#showLoading">showLoading</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Called to update the element to "Loading" state. Override to perform custom action.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#startAutoRefresh">startAutoRefresh</a>(<code>Number interval</code>, <span class="optional" title="Optional">[<code>String/Function url</code>]</span>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean refreshNow</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Set this element to auto refresh.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#stopAutoRefresh">stopAutoRefresh</a>() : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Stop auto refresh on this element.</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#update">update</a>(<code>Object/String/Function url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean discardUrl</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise i...</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#updateElement&lt;static&gt;">updateElement&lt;static&gt;</a>(<code>String/HTMLElement/YAHOO.ext.Element el</code>, <code>String url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>) : void</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">&lt;static&gt; Static convenience method, Usage:
<pre><code>YAHOO.ext.UpdateManager.update('my-div', 'stuff.php');</code></pre></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" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-beforeupdate">beforeupdate</a> : (<code>YAHOO.ext.Element el</code>, <code>String/Object/Function url</code>, <code>String/Object params</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Fired before an update is made, return false from your handler and the update is cancelled.</td>
</tr>
<tr class="alt">
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-failure">failure</a> : (<code>YAHOO.ext.Element el</code>, <code>Object oResponseObject</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr class="alt">
<td class="mdesc">Fired on update failure. Uses fireDirect with signature: (oElement, oResponseObject)</td>
</tr>
<tr>
<td class="micon" rowspan="2">&nbsp;</td>
<td class="sig"><a class="mlink" href="#event-update">update</a> : (<code>YAHOO.ext.Element el</code>, <code>Object oResponseObject</code>)</td>
<td class="msource" rowspan="2">UpdateManager</td>
</tr>
<tr>
<td class="mdesc">Fired after successful update is made.</td>
</tr>
</table>
<h2 class="mdetail-head">Property Details</h2>
<div class="detail-wrap">
<a name="defaultUrl"></a>
<div class="mdetail">
<h3>defaultUrl</i></h3>
<code>public String defaultUrl</code>
<div class="mdetail-desc">
Cached url to use for refreshes. Overwritten every time update() is called unless 'discardUrl' param is set to true. </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="disableCaching"></a>
<div class="mdetail alt">
<h3>disableCaching</i></h3>
<code>public Boolean disableCaching</code>
<div class="mdetail-desc">
Whether to append unique parameter on get request to disable caching (Defaults to false). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="el"></a>
<div class="mdetail">
<h3>el</i></h3>
<code>public YAHOO.ext.Element el</code>
<div class="mdetail-desc">
The Element object </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="formUpdateDelegate"></a>
<div class="mdetail alt">
<h3>formUpdateDelegate</i></h3>
<code>public Function formUpdateDelegate</code>
<div class="mdetail-desc">
Delegate for formUpdate() prebound to 'this', use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="indicatorText"></a>
<div class="mdetail">
<h3>indicatorText</i></h3>
<code>public String indicatorText</code>
<div class="mdetail-desc">
Text for loading indicator (Defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;'). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="loadScripts"></a>
<div class="mdetail alt">
<h3>loadScripts</i></h3>
<code>public Number loadScripts</code>
<div class="mdetail-desc">
True to process scripts by default (Defaults to false). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="refreshDelegate"></a>
<div class="mdetail">
<h3>refreshDelegate</i></h3>
<code>public Function refreshDelegate</code>
<div class="mdetail-desc">
Delegate for refresh() prebound to 'this', use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="renderer"></a>
<div class="mdetail alt">
<h3>renderer</i></h3>
<code>public Object renderer</code>
<div class="mdetail-desc">
The renderer for this UpdateManager. Defaults to <a href="YAHOO.ext.UpdateManager.BasicRenderer.html">YAHOO.ext.UpdateManager.BasicRenderer</a>. </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="showLoadIndicator"></a>
<div class="mdetail">
<h3>showLoadIndicator</i></h3>
<code>public String showLoadIndicator</code>
<div class="mdetail-desc">
Whether to show indicatorText when loading (Defaults to true). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="sslBlankUrl"></a>
<div class="mdetail alt">
<h3>sslBlankUrl</i></h3>
<code>public String sslBlankUrl</code>
<div class="mdetail-desc">
Blank page URL to use with SSL file uploads (Defaults to 'about:blank'). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="timeout"></a>
<div class="mdetail">
<h3>timeout</i></h3>
<code>public Number timeout</code>
<div class="mdetail-desc">
Timeout for requests or form posts in seconds (Defaults 30 seconds). </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="transaction"></a>
<div class="mdetail alt">
<h3>transaction</i></h3>
<code>public Object transaction</code>
<div class="mdetail-desc">
YAHOO.util.Connect transaction object of current executing transaction </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
<a name="updateDelegate"></a>
<div class="mdetail">
<h3>updateDelegate</i></h3>
<code>public Function updateDelegate</code>
<div class="mdetail-desc">
Delegate for update() prebound to 'this', use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments </div>
<div class="mdetail-def">This property is defined by UpdateManager.</div>
</div>
</div>
<a name="UpdateManager"></a>
<h2 class="mdetail-head">Constructor Details</h2>
<div class="detail-wrap">
<div class="mdetail">
<h3>UpdateManager</i></h3>
<code>public function UpdateManager(<code>String/HTMLElement/YAHOO.ext.Element el</code>, <span class="optional" title="Optional">[<code>Boolean forceNew</code>]</span>)</code>
<div class="mdetail-desc">
Create new UpdateManager directly. <div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement/YAHOO.ext.Element<div class="sub-desc">The element to update</div></li><li><code>forceNew</code> : Boolean<div class="sub-desc">(optional) By default the constructor checks to see if the passed element already has an UpdateManager and if it does it returns the same instance. This will skip that check (useful for extending this class).</div></li> </ul>
</div>
</div>
</div>
</div>
<h2 class="mdetail-head">Method Details</h2>
<div class="detail-wrap">
<a name="abort"></a>
<div class="mdetail">
<h3>abort</i></h3>
<code>public function abort()</code>
<div class="mdetail-desc">
Aborts the executing transaction
<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 UpdateManager.</div>
</div>
<a name="addListener"></a>
<div class="mdetail alt">
<h3>addListener</i></h3>
<code>public function addListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>boolean override</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li><li><code>override</code> : boolean<div class="sub-desc">(optional) If true, scope becomes the scope</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.ext.util.Observable.html#addListener">Observable</a>.</div>
</div>
<a name="delayedListener"></a>
<div class="mdetail">
<h3>delayedListener</i></h3>
<code>public function delayedListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>, <span class="optional" title="Optional">[<code>Number delay</code>]</span>)</code>
<div class="mdetail-desc">
Appends an event handler to this element that is delayed the specified number of milliseconds.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The method the event invokes</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</div></li><li><code>delay</code> : Number<div class="sub-desc">(optional) The number of milliseconds to delay</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Function</code><div class="sub-desc">The wrapped function that was created (can be used to remove the listener)</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#delayedListener">Observable</a>.</div>
</div>
<a name="fireEvent"></a>
<div class="mdetail alt">
<h3>fireEvent</i></h3>
<code>public function fireEvent(<code>String eventName</code>, <code>Object... args</code>)</code>
<div class="mdetail-desc">
Fires the specified event with the passed parameters (minus the event name).
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc"></div></li><li><code>args</code> : Object...<div class="sub-desc">Variable number of parameters are passed to handlers</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code><div class="sub-desc">returns false if any of the handlers return false otherwise it returns true</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by <a href="YAHOO.ext.util.Observable.html#fireEvent">Observable</a>.</div>
</div>
<a name="formUpdate"></a>
<div class="mdetail">
<h3>formUpdate</i></h3>
<code>public function formUpdate(<code>String/HTMLElement form</code>, <span class="optional" title="Optional">[<code>String url</code>]</span>, <span class="optional" title="Optional">[<code>Boolean reset</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>)</code>
<div class="mdetail-desc">
Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipart/form-data", it assumes it's a file upload.
Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning. See YUI docs for more info.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>form</code> : String/HTMLElement<div class="sub-desc">The form Id or form element</div></li><li><code>url</code> : String<div class="sub-desc">(optional) The url to pass the form to. If omitted the action attribute on the form will be used.</div></li><li><code>reset</code> : Boolean<div class="sub-desc">(optional) Whether to try to reset the form after the update</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="getEl"></a>
<div class="mdetail alt">
<h3>getEl</i></h3>
<code>public function getEl()</code>
<div class="mdetail-desc">
Get the Element this UpdateManager is bound to
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>YAHOO.ext.Element</code><div class="sub-desc">The element</div></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="isUpdating"></a>
<div class="mdetail">
<h3>isUpdating</i></h3>
<code>public function isUpdating()</code>
<div class="mdetail-desc">
Returns true if an update is in progress
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li>None.</li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>Boolean</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="purgeListeners"></a>
<div class="mdetail alt">
<h3>purgeListeners</i></h3>
<code>public function purgeListeners()</code>
<div class="mdetail-desc">
Removes all listeners for this object
<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.ext.util.Observable.html#purgeListeners">Observable</a>.</div>
</div>
<a name="refresh"></a>
<div class="mdetail">
<h3>refresh</i></h3>
<code>public function refresh(<span class="optional" title="Optional">[<code>Function callback</code>]</span>)</code>
<div class="mdetail-desc">
Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="removeListener"></a>
<div class="mdetail alt">
<h3>removeListener</i></h3>
<code>public function removeListener(<code>String eventName</code>, <code>Function handler</code>, <span class="optional" title="Optional">[<code>Object scope</code>]</span>)</code>
<div class="mdetail-desc">
Removes a listener
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>eventName</code> : String<div class="sub-desc">The type of event to listen for</div></li><li><code>handler</code> : Function<div class="sub-desc">The handler to remove</div></li><li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (this object) for the handler</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.ext.util.Observable.html#removeListener">Observable</a>.</div>
</div>
<a name="setDefaultUrl"></a>
<div class="mdetail">
<h3>setDefaultUrl</i></h3>
<code>public function setDefaultUrl(<code>String/Function defaultUrl</code>)</code>
<div class="mdetail-desc">
Set the defaultUrl used for updates
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>defaultUrl</code> : String/Function<div class="sub-desc">The url or a function to call to get the url</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="setRenderer"></a>
<div class="mdetail alt">
<h3>setRenderer</i></h3>
<code>public function setRenderer(<code>Object renderer</code>)</code>
<div class="mdetail-desc">
Set the content renderer for this UpdateManager. See <a href="YAHOO.ext.UpdateManager.BasicRenderer.html#render">YAHOO.ext.UpdateManager.BasicRenderer.render</a> for more details.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>renderer</code> : Object<div class="sub-desc">The object implementing the render() method</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="showLoading"></a>
<div class="mdetail">
<h3>showLoading</i></h3>
<code>public function showLoading()</code>
<div class="mdetail-desc">
Called to update the element to "Loading" state. Override to perform custom action.
<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 UpdateManager.</div>
</div>
<a name="startAutoRefresh"></a>
<div class="mdetail alt">
<h3>startAutoRefresh</i></h3>
<code>public function startAutoRefresh(<code>Number interval</code>, <span class="optional" title="Optional">[<code>String/Function url</code>]</span>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean refreshNow</code>]</span>)</code>
<div class="mdetail-desc">
Set this element to auto refresh.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>interval</code> : Number<div class="sub-desc">How often to update (in seconds).</div></li><li><code>url</code> : String/Function<div class="sub-desc">(optional) The url for this request or a function to call to get the url (Defaults to the last used url)</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) The parameters to pass as either a url encoded string "&param1=1&param2=2" or as an object {param1: 1, param2: 2}</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li><li><code>refreshNow</code> : Boolean<div class="sub-desc">(optional) Whether to execute the refresh now, or wait the interval</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="stopAutoRefresh"></a>
<div class="mdetail">
<h3>stopAutoRefresh</i></h3>
<code>public function stopAutoRefresh()</code>
<div class="mdetail-desc">
Stop auto refresh on this element.
<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 UpdateManager.</div>
</div>
<a name="update"></a>
<div class="mdetail alt">
<h3>update</i></h3>
<code>public function update(<code>Object/String/Function url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Function callback</code>]</span>, <span class="optional" title="Optional">[<code>Boolean discardUrl</code>]</span>)</code>
<div class="mdetail-desc">
Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise it uses GET.
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>url</code> : Object/String/Function<div class="sub-desc">The url for this request or a function to call to get the url or a config object containing any of the following options: <pre><code> um.update({ url: 'your-url.php', params: {param1: 'foo', param2: 'bar'}, // or a URL encoded string callback: yourFunction, scope: yourObject, //(optional scope) discardUrl: false, disableCaching: false, indicatorText: 'Loading...', timeout: 30, loadScripts: false }); </code></pre> The only required property is url. The optional properties nocache, text and scripts are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this UpdateManager instance.</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) The parameters to pass as either a url encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}</div></li><li><code>callback</code> : Function<div class="sub-desc">(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)</div></li><li><code>discardUrl</code> : Boolean<div class="sub-desc">(optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.</div></li> </ul>
<strong>Returns:</strong>
<ul>
<li><code>void</code></li>
</ul>
</div>
</div>
<div class="mdetail-def">This method is defined by UpdateManager.</div>
</div>
<a name="updateElement&lt;static&gt;"></a>
<div class="mdetail">
<h3>updateElement&lt;static&gt;</i></h3>
<code>public function updateElement&lt;static&gt;(<code>String/HTMLElement/YAHOO.ext.Element el</code>, <code>String url</code>, <span class="optional" title="Optional">[<code>String/Object params</code>]</span>, <span class="optional" title="Optional">[<code>Object options</code>]</span>)</code>
<div class="mdetail-desc">
&lt;static&gt; Static convenience method, Usage:
<pre><code>YAHOO.ext.UpdateManager.update('my-div', 'stuff.php');</code></pre>
<div class="mdetail-params">
<strong>Parameters:</strong>
<ul><li><code>el</code> : String/HTMLElement/YAHOO.ext.Element<div class="sub-desc">The element to update</div></li><li><code>url</code> : String<div class="sub-desc">The url</div></li><li><code>params</code> : String/Object<div class="sub-desc">(optional) Url encoded param string or an object of name/value pairs</div></li><li><code>options</code> : Object<div class="sub-desc">(optional) A config object with any of the UpdateManager properties you want to set - for example: {disableCaching:true, indicatorText: 'Loading 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 UpdateManager.</div>
</div>
</div>
<h2 class="mdetail-head">Event Details</h2>
<div class="detail-wrap">
<a name="event-beforeupdate"></a>
<div class="mdetail">
<h3>beforeupdate</i></h3>
<code>public event beforeupdate</code>
<div class="mdetail-desc">
Fired before an update is made, return false from your handler and the update is cancelled.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : YAHOO.ext.Element<div class="sub-desc"></div></li><li><code>url</code> : String/Object/Function<div class="sub-desc"></div></li><li><code>params</code> : String/Object<div class="sub-desc"></div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
<a name="event-failure"></a>
<div class="mdetail alt">
<h3>failure</i></h3>
<code>public event failure</code>
<div class="mdetail-desc">
Fired on update failure. Uses fireDirect with signature: (oElement, oResponseObject)
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : YAHOO.ext.Element<div class="sub-desc"></div></li><li><code>oResponseObject</code> : Object<div class="sub-desc">The YAHOO.util.Connect response Object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
<a name="event-update"></a>
<div class="mdetail">
<h3>update</i></h3>
<code>public event update</code>
<div class="mdetail-desc">
Fired after successful update is made.
<div class="mdetail-params">
<strong style="font-weight:normal;">Subscribers will be called with the following parameters:</strong>
<ul><li><code>el</code> : YAHOO.ext.Element<div class="sub-desc"></div></li><li><code>oResponseObject</code> : Object<div class="sub-desc">The YAHOO.util.Connect response Object</div></li> </ul>
</div>
</div>
<div class="mdetail-def">This event is defined by UpdateManager.</div>
</div>
</div>
</div>
<hr>
Copyright &copy; 2006 Jack Slocum. All rights reserved.
</body>
</html>