|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gwtext.client.core.JsObject
com.gwtext.client.core.UpdateManager
public class UpdateManager
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) { // } });
Field Summary |
---|
Fields inherited from class com.gwtext.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
UpdateManager(com.google.gwt.user.client.Element element)
Create new UpdateManager directly. |
|
UpdateManager(ExtElement element)
Create new UpdateManager directly. |
|
UpdateManager(com.google.gwt.core.client.JavaScriptObject jsObj)
|
|
UpdateManager(java.lang.String elementID)
Create new UpdateManager directly. |
Method Summary | |
---|---|
void |
abort()
Aborts the executing transaction. |
void |
addListener(java.lang.String eventName,
EventCallback cb)
Appends an event handler. |
void |
formUpdate(java.lang.String formID)
Performs an async form post, updating this element with the response. |
void |
formUpdate(java.lang.String formID,
java.lang.String url)
Performs an async form post, updating this element with the response. |
void |
formUpdate(java.lang.String formID,
java.lang.String url,
boolean reset,
UrlLoadCallback callback)
Performs an async form post, updating this element with the response. |
ExtElement |
getEl()
Get the Element this UpdateManager is bound to. |
static UpdateManager |
instance(com.google.gwt.core.client.JavaScriptObject jsObj)
|
boolean |
isUpdating()
Returns true if an update is in progress. |
void |
refresh()
Refresh the element with the last used url or defaultUrl. |
static void |
setDefaultDisableCaching(boolean disableCaching)
Whether to append unique parameter on get request to disable caching (Defaults to false). |
static void |
setDefaultIndicatorText(java.lang.String indicatorText)
Text for loading indicator (Defaults to '<div class="loading-indicator">Loading...</div>'). |
static void |
setDefaultLoadScripts(boolean loadScripts)
True to process scripts in the output (Defaults to false). |
static void |
setDefaultShowLoadIndicator(boolean showLoadIndicator)
Whether to show indicatorText when loading (Defaults to true). |
static void |
setDefaultSslBlankUrl(java.lang.String sslBlankUrl)
Blank page URL to use with SSL file uploads (Defaults to "about:blank"). |
static void |
setDefaultTimeout(int timeout)
Timeout for requests or form posts in seconds (Defaults to 30 seconds). |
void |
setDefaultUrl(java.lang.String url)
Set the defaultUrl used for updates. |
void |
setDisableCaching(boolean disableCaching)
True to disable caching. |
void |
setIndicatorText(java.lang.String indicatorText)
Set the loading indicator text. |
void |
setLoadScripts(boolean loadScripts)
Wheter to load scripts in the contents. |
void |
setMethod(Connection.Method method)
Request method (GET or POST). |
void |
setShowIndicator(boolean showIndicator)
Whether to show the loading indicator. |
void |
setTimeout(int timeout)
Timeout for the request. |
void |
startAutoRefresh(int interval)
Set this element to auto refresh. |
void |
startAutoRefresh(int interval,
java.lang.String url)
Set this element to auto refresh. |
void |
startAutoRefresh(int interval,
java.lang.String url,
java.lang.String params,
Function cb,
boolean refreshNow)
Set this element to auto refresh. |
void |
stopAutoRefresh()
Stop auto refresh on this element. |
void |
update(java.lang.String url,
java.lang.String params)
Performs an async request, updating this element with the response. |
void |
update(java.lang.String url,
UrlLoadConfig params,
UrlLoadCallback callback,
boolean discardUrl)
Performs an async request, updating this element with the response. |
Methods inherited from class com.gwtext.client.core.JsObject |
---|
getJsObj, getProperties, isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UpdateManager(java.lang.String elementID)
elementID
- the elemetn IDpublic UpdateManager(com.google.gwt.user.client.Element element)
element
- the elementpublic UpdateManager(ExtElement element)
element
- the elementpublic UpdateManager(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail |
---|
public static UpdateManager instance(com.google.gwt.core.client.JavaScriptObject jsObj)
public static void setDefaultTimeout(int timeout)
timeout
- the default timeoutpublic static void setDefaultLoadScripts(boolean loadScripts)
loadScripts
- true to laod scriptspublic static void setDefaultSslBlankUrl(java.lang.String sslBlankUrl)
sslBlankUrl
- ssl blank urlpublic static void setDefaultDisableCaching(boolean disableCaching)
disableCaching
- true to disable cachingpublic static void setDefaultShowLoadIndicator(boolean showLoadIndicator)
showLoadIndicator
- true to show indicatorpublic static void setDefaultIndicatorText(java.lang.String indicatorText)
indicatorText
- the indicator textpublic void abort()
public void addListener(java.lang.String eventName, EventCallback cb)
eventName
- the type of event to appendcb
- the event callbackpublic void formUpdate(java.lang.String formID)
formID
- the form IDpublic void formUpdate(java.lang.String formID, java.lang.String url)
formID
- the form IDurl
- The url to pass the form to. If omitted the action attribute on the form will be used.public void formUpdate(java.lang.String formID, java.lang.String url, boolean reset, UrlLoadCallback callback)
formID
- the form IDurl
- The url to pass the form to. If omitted the action attribute on the form will be used.reset
- Whether to try to reset the form after the updatecallback
- callback when transaction is completepublic ExtElement getEl()
public boolean isUpdating()
public void refresh()
public void setDefaultUrl(java.lang.String url)
url
- the default urlpublic void setDisableCaching(boolean disableCaching)
disableCaching
- true to disable cachingpublic void setIndicatorText(java.lang.String indicatorText)
indicatorText
- the indicator textpublic void setLoadScripts(boolean loadScripts)
loadScripts
- true to laod scriptspublic void setMethod(Connection.Method method)
method
- the request methodpublic void setShowIndicator(boolean showIndicator)
showIndicator
- true to show loading indicatorpublic void setTimeout(int timeout)
timeout
- the timeout in secondspublic void startAutoRefresh(int interval)
interval
- how often to update in secondspublic void startAutoRefresh(int interval, java.lang.String url)
interval
- how often to update in secondsurl
- The url for this request or a function to call to get the url (Defaults to the last used url)public void startAutoRefresh(int interval, java.lang.String url, java.lang.String params, Function cb, boolean refreshNow)
interval
- how often to update in secondsurl
- The url for this request or a function to call to get the url (Defaults to the last used url)params
- the parameters to pass as a url encoded string "¶m1=1¶m2=2"cb
- callback when the transaction is completerefreshNow
- whether to execute the refresh now, or wait the intervalpublic void stopAutoRefresh()
public void update(java.lang.String url, java.lang.String params)
url
- the url for this requestparams
- the parameters to pass as a url encoded string "param1=1¶m2=2"public void update(java.lang.String url, UrlLoadConfig params, UrlLoadCallback callback, boolean discardUrl)
url
- the url for this requestparams
- the parameters to pass as a url encoded string "param1=1¶m2=2"callback
- the callback when transaction is completediscardUrl
- by default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |