Using Experience Builder 11.4
I am trying to get the filter-feature-layer (arcgis-experience-builder-sdk-resources-master) custom widget to run for me.
Below is the code (my only change is verifying (console.log) that I do have the datasource.
const textInputChangeHandler = (evt) => {
if (props.useDataSources.length > 0) {
// First get the DataSourceManager instance
const dsManager = DataSourceManager.getInstance()
// Get the data source using useDataSource.dataSourceId
const useDataSource = props.useDataSources[0]
console.log(useDataSource.dataSourceId)
const ds: FeatureLayerDataSource = dsManager.getDataSource(useDataSource.dataSourceId) as FeatureLayerDataSource
// Build the queryParams, with the configured filterField and the value
// that has been typed into the TextInput by the user
const queryParams: SqlQueryParams = {
where: `${props.config.filterField} LIKE '%${evt.target.value}%'`
}
// Filter the data source using updateQueryParams function.
ds.updateQueryParams(queryParams, props.id)
}
}
On line 21, when it is time to pass the Query to the Datasource. The error is:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'updateQueryParams').
I have not been able to figure out how to capture the promise/result on this.
Any help would be appreciated.
BobinTN