com.smartgwt.client.data
Class XJSONDataSource
java.lang.Object
com.smartgwt.client.core.BaseClass
com.smartgwt.client.data.DataSource
com.smartgwt.client.data.XJSONDataSource
- All Implemented Interfaces:
- HasHandlers, HasHandleErrorHandlers
public class XJSONDataSource
- extends DataSource
A DataSource preconfigured to use the RPCTransport
transport
for cross-domain
calls to JSON services, such as those provided by Yahoo!.
To use this DataSource, provide the URL of the
service as dataURL
, and
provide 'fields'
that describe the structure of the data you want to
extract
from the service's response.
recordXPath
and
valueXPath
can be used to extract
data from the JSON
structure returned by the service. See
'Client-Side Data
Integration'
for an overview of how to
control what parts of the JSON structure are included in the DSResponse
object, and
hence provided to DataBoundComponent
s that are bound to this DataSource.
This XJSONDataSource
is really a subclass of DataSource with just a few property settings:
dataFormat : "json",
dataTransport : "scriptInclude"
callbackParam : "callback"
If you are also writing the
server side code to respond to requests from this DataSource,
see the
tutorial provided by
Yahoo!
for a good overview of how this transport mechanism works. Note, as indicated in the
tutorial
above, the server is responsible for writing out not just the data, but also a
JavaScript function call that tells
the client that the response has arrived. The client
passes the name of the function to call as the "callback" URL
parameter.
NOTE: if you use this DataSource to contact Yahoo web services, remember to include
output=json in the dataURL, as well as a
Yahoo developer ID.
Methods inherited from class com.smartgwt.client.data.DataSource |
addData, addData, addData, addField, addHandleErrorHandler, downloadFile, downloadFile, fetchData, fetchData, fetchData, fetchData, filterData, filterData, filterData, get, getAddGlobalId, getAutoDeriveSchema, getAutoDeriveTitles, getBeanClassName, getCallbackParam, getCanMultiSort, getChildrenField, getClientOnly, getClientOnlyResponse, getCriteriaPolicy, getDataFormat, getDataProtocol, getDataSource, getDataTransport, getDataURL, getDbName, getDefaultParams, getDropExtraFields, getField, getFieldNames, getFieldNames, getFields, getIconField, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getQualifyColumnNames, getQuoteColumnNames, getRecordXPath, getRequiresAuthentication, getRequiresRole, getResultBatchSize, getSchemaNamespace, getSendExtraFields, getServerConstructor, getServerType, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTableName, getTagName, getTestData, getTitle, getTitleField, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseParentFieldOrder, getValidateRelatedRecords, isCreated, load, load, onInit, processResponse, recordsFromXML, removeData, removeData, removeData, setAddGlobalId, setAutoDeriveSchema, setAutoDeriveTitles, setBeanClassName, setCallbackParam, setCanMultiSort, setChildrenField, setClientOnly, setCriteriaPolicy, setDataFormat, setDataProtocol, setDataTransport, setDataURL, setDbName, setDefaultParams, setDropExtraFields, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setFields, setIconField, setInheritsFrom, setJsonPrefix, setJsonSuffix, setOperationBindings, setPluralTitle, setPreventHTTPCaching, setQualifyColumnNames, setQuoteColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiresAuthentication, setRequiresRole, setResultBatchSize, setSendExtraFields, setServerConstructor, setServerType, setServiceNamespace, setShowLocalFieldsOnly, setShowPrompt, setStrictSQLFiltering, setTableName, setTagName, setTestData, setTitle, setTitleField, setUseFlatFields, setUseHttpProxy, setUseLocalValidators, setUseParentFieldOrder, setValidateRelatedRecords, setXmlNamespaces, supportsTextMatchStyle, transformRequest, transformResponse, updateData, updateData, updateData, viewFile, viewFile, xmlSerialize, xmlSerialize |
Methods inherited from class com.smartgwt.client.core.BaseClass |
destroy, doAddHandler, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsString, getConfig, getHandlerCount, getID, getOrCreateJsObj, getRef, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XJSONDataSource
public XJSONDataSource()
XJSONDataSource
public XJSONDataSource(JavaScriptObject jsObj)
getOrCreateRef
public static XJSONDataSource getOrCreateRef(JavaScriptObject jsObj)
create
public JavaScriptObject create()
- Overrides:
create
in class DataSource