|
|||||||||
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.Connection
public class Connection
The class encapsulates a connection to the page's originating domain, allowing requests to be made either to a configured URL, or to a URL specified at request time. Requests made by this class are asynchronous, and will return immediately. No data from the server will be available to the statement immediately following the request call. To process returned data, use a callback in the request options object, or an event listener. Note: If you are doing a file upload, you will not get a normal response object sent back to your callback or event handler. Since the upload is handled via in IFRAME, there is no XMLHttpRequest. The response object is created using the innerHTML of the IFRAME's document as the responseText property and, if present, the IFRAME's XML document as the responseXML property. This means that a valid XML or HTML document must be returned. If JSON data is required, it is suggested that it be placed either inside a <textarea> in an HTML document and retrieved from the responseText using a regex, or inside a CDATA section in an XML document and retrieved from the responseXML using standard DOM methods.
Nested Class Summary | |
---|---|
static class |
Connection.Method
HTTP request method constants. |
Field Summary | |
---|---|
static Connection.Method |
GET
Specifies that the HTTP GET method should be used. |
static Connection.Method |
POST
Specifies that the HTTP POST method should be used. |
Fields inherited from class com.gwtext.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
protected |
Connection()
|
|
Connection(ConnectionConfig config)
Constructs a Connection using the configuration parameters passed. |
|
Connection(com.google.gwt.core.client.JavaScriptObject jsObj)
Constructs a Connection using a native connection object. |
Method Summary | |
---|---|
void |
abort()
Aborts the last outstanding request. |
void |
abort(double transactionId)
Aborts any outstanding request. |
void |
addListener(ConnectionListener listener)
Adds a connection listener to this connection object. |
boolean |
isLoading()
Determine whether this object has a request outstanding. |
boolean |
isLoading(double transactionId)
Determine whether the specified transaction has a request outstanding. |
double |
request()
Sends an HTTP request to a remote server. |
double |
request(RequestParam param)
Sends an HTTP request to a remote server. |
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 |
Field Detail |
---|
public static final Connection.Method GET
public static final Connection.Method POST
Constructor Detail |
---|
protected Connection()
public Connection(com.google.gwt.core.client.JavaScriptObject jsObj)
jsObj
- native connection objectpublic Connection(ConnectionConfig config)
config
- the connection configMethod Detail |
---|
public void abort()
public void abort(double transactionId)
transactionId
- the transaction to abortpublic boolean isLoading()
public boolean isLoading(double transactionId)
transactionId
- the transaction id
public double request()
public double request(RequestParam param)
param
- the request params
public void addListener(ConnectionListener listener)
listener
- the connection listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |