| java.lang.Object com.gwtext.client.core.JsObject com.gwtext.client.core.UpdateManager
UpdateManager | public class UpdateManager extends JsObject (Code) | | Provides AJAX-style update for Element object.
Usage :
ExtElement el = Ext.get("foo");
UpdateManager mgr = el.getUpdateManager();
mgr.update("http://myserver.com/index.php", "param1=1¶m2=2");
mgr.formUpdate("myFormId", "http://myserver.com/index.php");
// or directly (returns the same UpdateManager instance)
UpdateManager mgr2 = new UpdateManager("myElementId");
mgr2.startAutoRefresh(60, "http://myserver.com/index.php");
mgr2.addListener("update", new EventCallback() {
public void execute(EventObject e) {
//
}
});
|
Method Summary | |
native public void | abort() Aborts the executing transaction. | native public void | addListener(String eventName, EventCallback cb) Appends an event handler. | native public void | formUpdate(String formID) Performs an async form post, updating this element with the response. | native public void | formUpdate(String formID, String url) Performs an async form post, updating this element with the response. | native public void | formUpdate(String formID, String url, boolean reset, UrlLoadCallback callback) Performs an async form post, updating this element with the response. | native public ExtElement | getEl() Get the Element this UpdateManager is bound to. | public static UpdateManager | instance(JavaScriptObject jsObj) | native public boolean | isUpdating() Returns true if an update is in progress. | native public void | refresh() Refresh the element with the last used url or defaultUrl. | native public static void | setDefaultDisableCaching(boolean disableCaching) Whether to append unique parameter on get request to disable caching (Defaults to false). | native public static void | setDefaultIndicatorText(String indicatorText) Text for loading indicator (Defaults to '<div class="loading-indicator">Loading...</div>'). | native public static void | setDefaultLoadScripts(boolean loadScripts) True to process scripts in the output (Defaults to false). | native public static void | setDefaultShowLoadIndicator(boolean showLoadIndicator) Whether to show indicatorText when loading (Defaults to true). | native public static void | setDefaultSslBlankUrl(String sslBlankUrl) Blank page URL to use with SSL file uploads (Defaults to "about:blank"). | native public static void | setDefaultTimeout(int timeout) Timeout for requests or form posts in seconds (Defaults to 30 seconds). | native public void | setDefaultUrl(String url) Set the defaultUrl used for updates. | native public void | setDisableCaching(boolean disableCaching) True to disable caching. | native public void | setIndicatorText(String indicatorText) Set the loading indicator text. | native public void | setLoadScripts(boolean loadScripts) Wheter to load scripts in the contents. | native public void | setMethod(Connection.Method method) Request method (GET or POST). | native public void | setShowIndicator(boolean showIndicator) Whether to show the loading indicator. | native public void | setTimeout(int timeout) Timeout for the request. | native public void | startAutoRefresh(int interval) Set this element to auto refresh. | native public void | startAutoRefresh(int interval, String url) Set this element to auto refresh. | native public void | startAutoRefresh(int interval, String url, String params, Function cb, boolean refreshNow) Set this element to auto refresh. | native public void | stopAutoRefresh() Stop auto refresh on this element. | native public void | update(String url, String params) Performs an async request, updating this element with the response. | public void | update(String url, UrlLoadConfig params, UrlLoadCallback callback, boolean discardUrl) Performs an async request, updating this element with the response. |
UpdateManager | public UpdateManager(String elementID)(Code) | | Create new UpdateManager directly.
Parameters: elementID - the elemetn ID |
UpdateManager | public UpdateManager(Element element)(Code) | | Create new UpdateManager directly.
Parameters: element - the element |
UpdateManager | public UpdateManager(ExtElement element)(Code) | | Create new UpdateManager directly.
Parameters: element - the element |
UpdateManager | public UpdateManager(JavaScriptObject jsObj)(Code) | | |
abort | native public void abort()(Code) | | Aborts the executing transaction.
|
addListener | native public void addListener(String eventName, EventCallback cb)(Code) | | Appends an event handler.
Parameters: eventName - the type of event to append Parameters: cb - the event callback |
formUpdate | native public void formUpdate(String formID)(Code) | | 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.
Parameters: formID - the form ID |
formUpdate | native public void formUpdate(String formID, String url)(Code) | | 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.
Parameters: formID - the form ID Parameters: url - The url to pass the form to. If omitted the action attribute on the form will be used. |
formUpdate | native public void formUpdate(String formID, String url, boolean reset, UrlLoadCallback callback)(Code) | | 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.
Parameters: formID - the form ID Parameters: url - The url to pass the form to. If omitted the action attribute on the form will be used. Parameters: reset - Whether to try to reset the form after the update Parameters: callback - callback when transaction is complete |
getEl | native public ExtElement getEl()(Code) | | Get the Element this UpdateManager is bound to.
the element |
isUpdating | native public boolean isUpdating()(Code) | | Returns true if an update is in progress.
true if update in progress |
refresh | native public void refresh()(Code) | | Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately.
|
setDefaultDisableCaching | native public static void setDefaultDisableCaching(boolean disableCaching)(Code) | | Whether to append unique parameter on get request to disable caching (Defaults to false).
Parameters: disableCaching - true to disable caching |
setDefaultIndicatorText | native public static void setDefaultIndicatorText(String indicatorText)(Code) | | Text for loading indicator (Defaults to '<div class="loading-indicator">Loading...</div>').
Parameters: indicatorText - the indicator text |
setDefaultLoadScripts | native public static void setDefaultLoadScripts(boolean loadScripts)(Code) | | True to process scripts in the output (Defaults to false).
Parameters: loadScripts - true to laod scripts |
setDefaultShowLoadIndicator | native public static void setDefaultShowLoadIndicator(boolean showLoadIndicator)(Code) | | Whether to show indicatorText when loading (Defaults to true).
Parameters: showLoadIndicator - true to show indicator |
setDefaultSslBlankUrl | native public static void setDefaultSslBlankUrl(String sslBlankUrl)(Code) | | Blank page URL to use with SSL file uploads (Defaults to "about:blank").
Parameters: sslBlankUrl - ssl blank url |
setDefaultTimeout | native public static void setDefaultTimeout(int timeout)(Code) | | Timeout for requests or form posts in seconds (Defaults to 30 seconds).
Parameters: timeout - the default timeout |
setDefaultUrl | native public void setDefaultUrl(String url)(Code) | | Set the defaultUrl used for updates.
Parameters: url - the default url |
setDisableCaching | native public void setDisableCaching(boolean disableCaching)(Code) | | True to disable caching.
Parameters: disableCaching - true to disable caching |
setIndicatorText | native public void setIndicatorText(String indicatorText)(Code) | | Set the loading indicator text.
Parameters: indicatorText - the indicator text |
setLoadScripts | native public void setLoadScripts(boolean loadScripts)(Code) | | Wheter to load scripts in the contents.
Parameters: loadScripts - true to laod scripts |
setMethod | native public void setMethod(Connection.Method method)(Code) | | Request method (GET or POST).
Parameters: method - the request method |
setShowIndicator | native public void setShowIndicator(boolean showIndicator)(Code) | | Whether to show the loading indicator.
Parameters: showIndicator - true to show loading indicator |
setTimeout | native public void setTimeout(int timeout)(Code) | | Timeout for the request.
Parameters: timeout - the timeout in seconds |
startAutoRefresh | native public void startAutoRefresh(int interval)(Code) | | Set this element to auto refresh.
Parameters: interval - how often to update in seconds |
startAutoRefresh | native public void startAutoRefresh(int interval, String url)(Code) | | Set this element to auto refresh.
Parameters: interval - how often to update in seconds Parameters: url - The url for this request or a function to call to get the url (Defaults to the last used url) |
startAutoRefresh | native public void startAutoRefresh(int interval, String url, String params, Function cb, boolean refreshNow)(Code) | | Set this element to auto refresh.
Parameters: interval - how often to update in seconds Parameters: url - The url for this request or a function to call to get the url (Defaults to the last used url) Parameters: params - the parameters to pass as a url encoded string "¶m1=1¶m2=2" Parameters: cb - callback when the transaction is complete Parameters: refreshNow - whether to execute the refresh now, or wait the interval |
stopAutoRefresh | native public void stopAutoRefresh()(Code) | | Stop auto refresh on this element.
|
update | native public void update(String url, String params)(Code) | | Performs an async request, updating this element with the response. If params are specified it uses POST,
otherwise it uses GET.
Parameters: url - the url for this request Parameters: params - the parameters to pass as a url encoded string "param1=1¶m2=2" |
update | public void update(String url, UrlLoadConfig params, UrlLoadCallback callback, boolean discardUrl)(Code) | | Performs an async request, updating this element with the response. If params are specified it uses POST,
otherwise it uses GET.
Parameters: url - the url for this request Parameters: params - the parameters to pass as a url encoded string "param1=1¶m2=2" Parameters: callback - the callback when transaction is complete Parameters: discardUrl - by default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url. |
Fields inherited from com.gwtext.client.core.JsObject | protected JavaScriptObject jsObj(Code)(Java Doc)
|
|
|