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 "scriptInclude" 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 DataBoundComponents 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, combineCriteria, combineCriteria, convertRelativeDates, convertRelativeDates, downloadFile, downloadFile, exportClientData, fetchData, fetchData, fetchData, fetchData, filterData, filterData, filterData, get, getAddGlobalId, getAutoCacheAllData, getAutoConvertRelativeDates, getAutoDeriveSchema, getAutoDeriveTitles, getBeanClassName, getCacheAllData, getCacheData, getCacheMaxAge, getCallbackParam, getCanMultiSort, getChildrenField, getClientOnly, getClientOnlyResponse, getCriteriaPolicy, getDataFormat, getDataProtocol, getDataSource, getDataTransport, getDataURL, getDefaultParams, getDisplayValue, getDropExtraFields, getField, getFieldNames, getFieldNames, getFields, getIconField, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getQualifyColumnNames, getRecordXPath, getRequiredMessage, getResultBatchSize, getSchemaNamespace, getSendExtraFields, getServerConstructor, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTagName, getTestData, getTitle, getTitleField, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseParentFieldOrder, getUseTestDataFetch, getValidateRelatedRecords, hasAllData, invalidateCache, isCreated, load, load, onInit, performCustomOperation, performCustomOperation, processResponse, recordsFromXML, removeData, removeData, removeData, setAddGlobalId, setAutoCacheAllData, setAutoConvertRelativeDates, setAutoDeriveSchema, setAutoDeriveTitles, setBeanClassName, setCacheAllData, setCacheData, setCacheMaxAge, setCallbackParam, setCanMultiSort, setChildrenField, setClientOnly, setCriteriaPolicy, setDataFormat, setDataProtocol, setDataTransport, setDataURL, setDefaultParams, setDropExtraFields, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setFields, setIconField, setInheritsFrom, setJsonPrefix, setJsonSuffix, setOperationBindings, setPluralTitle, setPreventHTTPCaching, setQualifyColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiredMessage, setResultBatchSize, setSendExtraFields, setServerConstructor, setServiceNamespace, setShowLocalFieldsOnly, setShowPrompt, setStrictSQLFiltering, setTagName, setTestData, setTitle, setTitleField, setUseFlatFields, setUseHttpProxy, setUseLocalValidators, setUseParentFieldOrder, setUseTestDataFetch, setValidateRelatedRecords, setXmlNamespaces, supportsTextMatchStyle, transformRequest, transformResponse, updateCaches, updateCaches, updateData, updateData, updateData, validateData, 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, getScClassName, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setID, setProperty, setProperty, setProperty, setProperty, setScClassName |
| 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