com.smartgwt.client.data
Class XJSONDataSource

java.lang.Object
  extended by com.smartgwt.client.core.BaseClass
      extended by com.smartgwt.client.data.DataSource
          extended by com.smartgwt.client.data.XJSONDataSource
All Implemented Interfaces:
HasHandlers, HasHandleErrorHandlers

public class XJSONDataSource
extends DataSource

A DataSource preconfigured to use the "scriptInclude" transport (sometimes called "JSONP") for cross-domain calls to JSON services.

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.


Field Summary
 
Fields inherited from class com.smartgwt.client.core.BaseClass
config, id, scClassName
 
Constructor Summary
XJSONDataSource()
           
XJSONDataSource(JavaScriptObject jsObj)
           
 
Method Summary
 JavaScriptObject create()
           
static XJSONDataSource getOrCreateRef(JavaScriptObject jsObj)
           
 
Methods inherited from class com.smartgwt.client.data.DataSource
addData, addData, addData, addField, addHandleErrorHandler, applyFilter, applyFilter, canFlattenCriteria, combineCriteria, combineCriteria, combineCriteria, compareCriteria, compareCriteria, compareCriteria, compareDates, convertCriteria, convertCriteria, convertDataSourceCriteria, convertDataSourceCriteria, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, copyCriteria, copyRecord, copyRecords, downloadFile, downloadFile, downloadFile, evaluateCriterion, exportClientData, exportClientDataStatic, exportData, exportData, exportData, exportData, fetchData, fetchData, fetchData, fetchData, fetchRecord, fetchRecord, fetchRecord, fieldMatchesFilter, fieldMatchesFilter, filterData, filterData, filterData, filterData, flattenCriteria, get, get, getAddGlobalId, getAdvancedCriteriaDescription, getAllowAdvancedCriteria, getAutoCacheAllData, getAutoConvertRelativeDates, getAutoDeriveTitles, getAutoTitle, getCacheAcrossOperationIds, getCacheAllData, getCacheAllOperationId, getCacheData, getCacheMaxAge, getCallbackParam, getCanMultiSort, getChildrenField, getClientOnly, getClientOnlyDataSource, getClientOnlyDataSource, getClientOnlyDataSource, getClientOnlyResponse, getCriteriaPolicy, getDataField, getDataFormat, getDataProtocol, getDataSource, getDataSource, getDataTransport, getDataURL, getDefaultParams, getDefaultTextMatchStyle, getDescriptionField, getDisplayValue, getDropExtraFields, getDropUnknownCriteria, getFetchDataURL, getFetchDataURL, getField, getFieldAutoTitle, getFieldCriterion, getFieldForDataPath, getFieldNames, getFieldNames, getFieldOperators, getFieldOperators, getFields, getFieldValue, getFieldValue, getFieldValue, getFieldValue, getFileURL, getFileURL, getFileURL, getGlobalNamespaces, getIconField, getIgnoreTextMatchStyleCaseSensitive, getInfoField, getInheritsFrom, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getOperationBindings, getPatternEscapeChar, getPatternMultiWildcard, getPatternMultiWildcardAsString, getPatternSingleWildcard, getPatternSingleWildcardAsString, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getPrimaryKeyFieldNames, getPrimaryKeyFields, getProgressiveLoading, getQualifyColumnNames, getRecordXPath, getRequestProperties, getRequiredMessage, getResultBatchSize, getResultSetClass, getSchemaNamespace, getSendExtraFields, getSendParentNode, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTagName, getTestData, getTitle, getTitleField, getTranslatePatternOperators, getTrimMilliseconds, getTypeOperators, getTypeOperators, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseOfflineStorage, getUseParentFieldOrder, getUseStrictJSON, getUseTestDataFetch, getValidateRelatedRecords, hasAllData, invalidateCache, isCreated, isFlatCriteria, load, load, load, loadWithParents, loadWithParents, loadWithParents, onInit, performCustomOperation, performCustomOperation, performCustomOperation, performCustomOperation, processResponse, recordsAreEqual, recordsAsText, recordsAsText, recordsFromText, recordsFromText, recordsFromXML, registerID, removeData, removeData, removeData, setAddGlobalId, setAllowAdvancedCriteria, setAutoCacheAllData, setAutoConvertRelativeDates, setAutoDeriveTitles, setCacheAllData, setCacheData, setCacheMaxAge, setCallbackParam, setCanMultiSort, setChildrenField, setClientOnly, setCriteriaPolicy, setDataField, setDataFormat, setDataProtocol, setDataTransport, setDataURL, setDefaultParams, setDefaultTextMatchStyle, setDescriptionField, setDropExtraFields, setDropUnknownCriteria, setEnumConstantProperty, setEnumOrdinalProperty, setEnumTranslateStrategy, setFields, setGlobalNamespaces, setHandleErrorCallback, setIconField, setID, setIgnoreTextMatchStyleCaseSensitive, setInfoField, setInheritsFrom, setInheritsFrom, setJsonPrefix, setJsonSuffix, setOperationBindings, setPatternEscapeChar, setPatternMultiWildcard, setPatternMultiWildcard, setPatternSingleWildcard, setPatternSingleWildcard, setPluralTitle, setPreventHTTPCaching, setProgressiveLoading, setQualifyColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiredMessage, setResultBatchSize, setResultSetClass, setSendExtraFields, setSendParentNode, setServiceNamespace, setShowLocalFieldsOnly, setShowPrompt, setStrictSQLFiltering, setTagName, setTestData, setTitle, setTitleField, setTranslatePatternOperators, setTrimMilliseconds, setTypeOperators, setTypeOperators, setUseFlatFields, setUseHttpProxy, setUseLocalValidators, setUseOfflineStorage, setUseParentFieldOrder, setUseStrictJSON, setUseTestDataFetch, setValidateRelatedRecords, setXmlNamespaces, splitCriteria, supportsAdvancedCriteria, supportsTextMatchStyle, transformRequest, transformResponse, updateCaches, updateCaches, updateData, updateData, updateData, useOfflineResponse, validateData, validateData, validateData, viewFile, viewFile, viewFile, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize, xmlSerialize
 
Methods inherited from class com.smartgwt.client.core.BaseClass
asSGWTComponent, createJsObj, destroy, doAddHandler, doInit, error, error, errorIfNotCreated, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsMap, getAttributeAsString, getAttributeAsStringArray, getClassName, getConfig, getHandlerCount, getID, getOrCreateJsObj, getRef, getScClassName, hasAutoAssignedID, internalSetID, internalSetID, onBind, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setJavaScriptObject, setProperty, setProperty, setProperty, setProperty, setScClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

XJSONDataSource

public XJSONDataSource()

XJSONDataSource

public XJSONDataSource(JavaScriptObject jsObj)
Method Detail

getOrCreateRef

public static XJSONDataSource getOrCreateRef(JavaScriptObject jsObj)

create

public JavaScriptObject create()
Overrides:
create in class DataSource