ObservableUpdater
| Package: | CQ.Ext |
| Class: | Updater |
| Extends: | CQ.Ext.util.Observable |
| Clientlib: | cq.widgets |
var el = CQ.Ext.get("foo"); // Get CQ.Ext.Element object
var mgr = el.getUpdater();
mgr.update({
url: "http://myserver.com/index.php",
params: {
param1: "foo",
param2: "bar"
}
});
...
mgr.formUpdate("myFormId", "http://myserver.com/index.php");
// or directly (returns the same Updater instance)
var mgr = new CQ.Ext.Updater("myElementId");
mgr.startAutoRefresh(60, "http://myserver.com/index.php");
mgr.on("update", myFcnNeedsToKnow);
// short handed call directly from the element object
CQ.Ext.get("foo").load({
url: "bar.php",
scripts: true,
params: "param1=foo¶m2=bar",
text: "Loading Foo..."
}); | Property | Defined By | |
|---|---|---|
|
disableCaching : Boolean
Whether to append unique parameter on get request to disable caching (defaults to CQ.Ext.Updater.defaults.disableCac...
Whether to append unique parameter on get request to disable caching (defaults to CQ.Ext.Updater.defaults.disableCaching).
|
Updater | |
|
indicatorText : String
Text for loading indicator (defaults to CQ.Ext.Updater.defaults.indicatorText).
|
Updater | |
|
loadScripts : Boolean
True to process scripts in the output (defaults to CQ.Ext.Updater.defaults.loadScripts).
|
Updater | |
|
showLoadIndicator : String
Whether to show indicatorText when loading (defaults to CQ.Ext.Updater.defaults.showLoadIndicator).
|
Updater | |
|
sslBlankUrl : String
Blank page URL to use with SSL file uploads (defaults to CQ.Ext.Updater.defaults.sslBlankUrl).
|
Updater | |
|
timeout : Number
Timeout for requests or form posts in seconds (defaults to CQ.Ext.Updater.defaults.timeout).
|
Updater | |
| Method | Defined By | |
|---|---|---|
Updater( Mixed el, [Boolean forceNew] ) Create new Updater directly.
Create new Updater directly.
Parameters:
|
Updater | |
Updater.updateElement( Mixed el, String url, [String/Object params], [Object options] ) : void Deprecated.
<static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:...
<static> Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
Usage:
Parameters:
|
Updater | |
|
abort() : void Aborts the currently executing transaction, if any.
Aborts the currently executing transaction, if any.
Parameters:
|
Updater | |
enableBubble( String/Array events ) : void Enables events fired by this Observable to bubble up an owner hierarchy by calling
this.getBubbleTarget() if present....
Enables events fired by this Observable to bubble up an owner hierarchy by calling
This is commonly used by CQ.Ext.Components to bubble events to owner Containers. See CQ.Ext.Component.getBubbleTarget. The default implementation in CQ.Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to access the required target more quickly. Example:
Parameters:
|
Observable | |
formUpdate( String/HTMLElement form, [String url], [Boolean reset], [Function callback] ) : void Performs an asynchronous form post, updating this element with the response. If the form has the attribute
enctype='m...
Performs an asynchronous 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. File uploads are not performed using normal "Ajax" techniques, that is they are not
performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the
DOM Be aware that file upload packets, sent with the content type multipart/form-data and some server technologies (notably JEE) may require some custom processing in order to retrieve parameter names and parameter values from the packet content.
Parameters:
|
Updater | |
|
getDefaultRenderer() : void This is an overrideable method which returns a reference to a default
renderer class if none is specified when creati...
This is an overrideable method which returns a reference to a default
renderer class if none is specified when creating the CQ.Ext.Updater.
Defaults to CQ.Ext.Updater.BasicRenderer
Parameters:
|
Updater | |
|
getEl() : CQ.Ext.Element Get the Element this Updater is bound to
Get the Element this Updater is bound to
Parameters:
|
Updater | |
|
getRenderer() : Object Returns the current content renderer for this Updater. See CQ.Ext.Updater.BasicRenderer.render for more details.
Returns the current content renderer for this Updater. See CQ.Ext.Updater.BasicRenderer.render for more details.
Parameters:
|
Updater | |
|
isAutoRefreshing() : void Returns true if the Updater is currently set to auto refresh its content (see startAutoRefresh), otherwise false.
Returns true if the Updater is currently set to auto refresh its content (see startAutoRefresh), otherwise false.
Parameters:
|
Updater | |
|
isUpdating() : Boolean Returns true if an update is in progress, otherwise false.
Returns true if an update is in progress, otherwise false.
Parameters:
|
Updater | |
refresh( [Function callback] ) : void Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
Parameters:
|
Updater | |
relayEvents( Object o, Array events ) : void Relays selected events from the specified Observable as if the events were fired by this.
Relays selected events from the specified Observable as if the events were fired by this.
Parameters:
|
Observable | |
setDefaultUrl( String/Function defaultUrl ) : void Sets the default URL used for updates.
Sets the default URL used for updates.
Parameters:
|
Updater | |
setRenderer( Object renderer ) : void Sets the content renderer for this Updater. See CQ.Ext.Updater.BasicRenderer.render for more details.
Sets the content renderer for this Updater. See CQ.Ext.Updater.BasicRenderer.render for more details.
Parameters:
|
Updater | |
|
showLoading() : void Display the element's "loading" state. By default, the element is updated with indicatorText. This
method may be over...
Display the element's "loading" state. By default, the element is updated with indicatorText. This
method may be overridden to perform a custom action while this Updater is actively updating its contents.
Parameters:
|
Updater | |
startAutoRefresh( Number interval, [String/Object/Function url], [String/Object params], [Function callback], [Boolean refreshNow] ) : void Set this element to auto refresh. Can be canceled by calling stopAutoRefresh.
Set this element to auto refresh. Can be canceled by calling stopAutoRefresh.
Parameters:
|
Updater | |
|
stopAutoRefresh() : void Stop auto refresh on this element.
Stop auto refresh on this element.
Parameters:
|
Updater | |
update( Object options ) : void Performs an asynchronous request, updating this element with the response.
If params are specified it uses POST, othe...
Performs an asynchronous request, updating this element with the response.
If params are specified it uses POST, otherwise it uses GET.
Note: Due to the asynchronous nature of remote server requests, the Element will not have been fully updated when the function returns. To post-process the returned data, use the callback option, or an update event handler.
Parameters:
|
Updater | |