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

java.lang.Object
  extended by com.sencha.gxt.data.client.loader.HttpProxy<C>
Type Parameters:
C - the type of data used to configure the load from the proxy
All Implemented Interfaces:
DataProxy<C,java.lang.String>

public class HttpProxy<C>
extends java.lang.Object
implements DataProxy<C,java.lang.String>

A DataProxy that retrieves data using a RequestBuilder instance.

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:
RequestBuilder, ScriptTagProxy

Constructor Summary
HttpProxy(RequestBuilder builder)
          Creates a new HttpProxy.
 
Method Summary
 DataWriter<C,java.lang.String> getWriter()
          Returns the data writer for this proxy.
 void load(C loadConfig, Callback<java.lang.String,java.lang.Throwable> callback)
          Data should be retrieved using the specified load config.
 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

HttpProxy

public HttpProxy(RequestBuilder builder)
Creates a new HttpProxy.

Parameters:
builder - the request builder. The URL must be set to the URL of the service. For requests that use the HTTP GET method, the URL should be set to the base part of the URL. It will be updated automatically to include the encoded request.
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<java.lang.String,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,java.lang.String>
Parameters:
loadConfig - the load config object to be passed to server
callback - the data callback

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.