com.smartgwt.client.data

## Class FacadeDataSource

- java.lang.Object
- - com.smartgwt.client.core.BaseClass
  - - com.smartgwt.client.data.DataSource
    - - com.smartgwt.client.data.FacadeDataSource

- All Implemented Interfaces:
    HasHandlers, HasHandleErrorHandlers

      public class FacadeDataSource
      extends DataSource

  Extends an arbitrary `DataSource` with the ability to queue requests made on it and dispatch the queued requests on demand. To use, create a FacadeDataSource instance with the `inheritsFrom` property set to the DataSource that you wish to extend.

  This advanced class is intended to be used for testing data-bound components. This should not be used in production code.

  See also the overview of the `DataSource Facade pattern`.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.BaseClass

      `config, factoryCreated, factoryProperties, id, scClassName`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FacadeDataSource()`
    `FacadeDataSource(JavaScriptObject jsObj)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearQueue()` Shorthand to clear the `request queue` without changing the value of `queueRequests`.
    `JavaScriptObject` | `create()`
    `static FacadeDataSource` | `getOrCreateRef(JavaScriptObject jsObj)`
    `DSRequest[]` | `getQueuedRequests()` An array of derived DS requests that are queued to be `executed` on the underlying `inherited` DataSource.
    `boolean` | `getQueueRequests()` Should requests be queued?
    `void` | `setQueueRequests(boolean queueRequests)` Should requests be queued?

    - ### Methods inherited from class com.smartgwt.client.data.DataSource

      `addData, addData, addData, addField, addHandleErrorHandler, applyFilter, applyFilter, canFlattenCriteria, cloneDSRequest, cloneDSResponse, combineCriteria, combineCriteria, combineCriteria, compareCriteria, compareCriteria, compareCriteria, compareDates, convertCriteria, convertCriteria, convertDataSourceCriteria, convertDataSourceCriteria, convertRelativeDates, convertRelativeDates, convertRelativeDates, convertRelativeDates, copyCriteria, copyRecord, copyRecords, downloadFile, downloadFile, downloadFile, evaluateCriterion, execute, 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, getFile, getFileURL, getFileURL, getFileURL, getGlobalNamespaces, getIconField, getIgnoreTextMatchStyleCaseSensitive, getInfoField, getInheritsFrom, getJsObj, getJsonPrefix, getJsonSuffix, getLegalChildTags, getLoaderURL, getOperationBindings, getPatternEscapeChar, getPatternMultiWildcard, getPatternMultiWildcardAsString, getPatternSingleWildcard, getPatternSingleWildcardAsString, getPluralTitle, getPreventHTTPCaching, getPrimaryKeyField, getPrimaryKeyFieldName, getPrimaryKeyFieldNames, getPrimaryKeyFields, getProgressiveLoading, getQualifyColumnNames, getRecordName, getRecordXPath, getRequestProperties, getRequiredMessage, getResultBatchSize, getResultSetClass, getResultTreeClass, getSchemaNamespace, getSendExtraFields, getSendParentNode, getServiceNamespace, getShowLocalFieldsOnly, getShowPrompt, getSortBy, getSortSpecifiers, getStrictSQLFiltering, getTagName, getTestData, getTitle, getTitleField, getTranslatePatternOperators, getTrimMilliseconds, getTypeOperators, getTypeOperators, getTypeOperators, getUseFlatFields, getUseHttpProxy, getUseLocalValidators, getUseOfflineStorage, getUseParentFieldOrder, getUseStrictJSON, getUseTestDataFetch, getValidateRelatedRecords, hasAllData, hasFile, invalidateCache, isCreated, isFlatCriteria, listFiles, load, load, load, loadWithParents, loadWithParents, loadWithParents, makeFileSpec, onInit, performCustomOperation, performCustomOperation, performCustomOperation, performCustomOperation, processResponse, recordsAreEqual, recordsAsText, recordsAsText, recordsFromText, recordsFromText, recordsFromXML, registerID, removeData, removeData, removeData, removeFile, removeFile, removeFile, renameFile, renameFile, saveFile, saveFile, setAddGlobalId, setAllowAdvancedCriteria, setAutoCacheAllData, setAutoConvertRelativeDates, setAutoDeriveTitles, setCacheAcrossOperationIds, setCacheAllData, setCacheAllOperationId, 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, setLoaderURL, setOperationBindings, setPatternEscapeChar, setPatternMultiWildcard, setPatternMultiWildcard, setPatternSingleWildcard, setPatternSingleWildcard, setPluralTitle, setPreventHTTPCaching, setProgressiveLoading, setQualifyColumnNames, setRecordName, setRecordXPath, setRequestProperties, setRequiredMessage, setResultBatchSize, setResultSetClass, setResultTreeClass, 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

      `applyFactoryProperties, 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, getTestInstance, hasAutoAssignedID, internalSetID, internalSetID, isFactoryCreated, onBind, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setConfig, setFactoryCreated, 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

    - #### FacadeDataSource

          public FacadeDataSource()

    - #### FacadeDataSource

          public FacadeDataSource(JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static FacadeDataSource getOrCreateRef(JavaScriptObject jsObj)

    - #### create

          public JavaScriptObject create()

      Overrides:
        `create` in class `DataSource`

    - #### getQueuedRequests

          public DSRequest[] getQueuedRequests()
                                        throws java.lang.IllegalStateException

      An array of derived DS requests that are queued to be `executed` on the underlying `inherited` DataSource.

      When a DS request is made on this FacadeDataSource, if `queueRequests` is true, then a new DS request is created based on the given DS request and added to this queue.

      To clear the queue, set `queueRequests` to false or call `clearQueue()`.

      Note : This method should be called only after the underlying component has been created.

      Returns:
        DSRequest...
      Throws:
        `java.lang.IllegalStateException` - if the underlying component has not yet been created.

    - #### setQueueRequests

          public void setQueueRequests(boolean queueRequests)

      Should requests be queued?

      When DS requests are made on the FacadeDataSource, a new, derived DS request on the underlying `inherited` DataSource is created. If queueRequests is true, then the derived DS request is added to the `queuedRequests` array. If false, then the derived DS request is `executed` immediately on the inherited DataSource.
      If this method is called after the component has been drawn/initialized: Setter for `queueRequests`.

      Parameters:
        `queueRequests` - Default value is false

    - #### getQueueRequests

          public boolean getQueueRequests()

      Should requests be queued?

      When DS requests are made on the FacadeDataSource, a new, derived DS request on the underlying `inherited` DataSource is created. If queueRequests is true, then the derived DS request is added to the `queuedRequests` array. If false, then the derived DS request is `executed` immediately on the inherited DataSource.

      Returns:
        boolean

    - #### clearQueue

          public void clearQueue()

      Shorthand to clear the `request queue` without changing the value of `queueRequests`.