com.sencha.gxt.data.client.loader
Class ScriptTagProxy<C>

java.lang.Object
  extended by com.sencha.gxt.data.client.loader.ScriptTagProxy<C>
All Implemented Interfaces:
DataProxy<C,JavaScriptObject>

public class ScriptTagProxy<C>
extends java.lang.Object
implements DataProxy<C,JavaScriptObject>

A DataProxy that reads a data from a URL which may be in a domain other than the originating domain of the running page.

Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain of the running page, you must use this class, rather than HttpProxy.

When using a load config object that implements LoadConfig or ModelData, all properties and property values will be sent as request parameters in the load request.

See Also:
HttpProxy

Constructor Summary
ScriptTagProxy(java.lang.String url)
          Creates a script tag proxy that reads data from a URL that may be in a domain other than the originating domain of the running page.
 
Method Summary
 DataWriter<C,java.lang.String> getWriter()
          Returns the data writer for this proxy.
 void load(C loadConfig, Callback<JavaScriptObject,java.lang.Throwable> callback)
          Data should be retrieved using the specified load config.
 void setUrl(java.lang.String url)
          Sets the proxy's url.
 void setWriter(DataWriter<C,java.lang.String> writer)
          Sets the data writer for this proxy.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptTagProxy

public ScriptTagProxy(java.lang.String url)
Creates a script tag proxy that reads data from a URL that may be in a domain other than the originating domain of the running page.

Parameters:
url - the URL representing the data to retrieve
Method Detail

getWriter

public DataWriter<C,java.lang.String> getWriter()
Returns the data writer for this proxy. The data writer is responsible for encoding the load config.

Returns:
the data writer

load

public void load(C loadConfig,
                 Callback<JavaScriptObject,java.lang.Throwable> callback)
Description copied from interface: DataProxy
Data should be retrieved using the specified load config. When specified, the DataReader can be used to "process" the raw data.

Specified by:
load in interface DataProxy<C,JavaScriptObject>
Parameters:
loadConfig - the load config object to be passed to server
callback - the data callback

setUrl

public void setUrl(java.lang.String url)
Sets the proxy's url.

Parameters:
url - the url

setWriter

public void setWriter(DataWriter<C,java.lang.String> writer)
Sets the data writer for this proxy. The data writer is responsible for encoding the load config.

Parameters:
writer - the data writer


Copyright © 2012. All Rights Reserved.