We have a large internal custom EB app using a mix of custom and ESRI widgets. Currently using EB Dev Edition, Build 1.16.
In our custom EB app, we are dynamically loading/unloading featurelayers at runtime via a custom TOC widget, as the enduser chooses them at runtime.
We are also using the ESRI Table widget to display the layer attributes. This Table widget is set to the relatively new "Interact with a Map widget" Source option, so that it picks up the loading/unloading of layers. This somewhat works.
Here is the issue: In our custom TOC widget, we allow the user to choose which layer attribute table is currently displayed/active in the ESRI Table widget. This function is highly desirable because there are a large number of layers and also the ESRI Table widget unfortunately lists them in random (unsorted) order. To do this, we're using some custom code (see below) that worked in EB Build 1.16, but is now broken in the new Build 1.17, because ESRI has partly rewritten the 1.17 Table widget. This is preventing us from moving forward from EB Build 1.16.
The request is that ESRI would restore equivalent functionality in the Table widget that allows another custom widget to script which layer is currently displayed/active in the Table widget.
Code snippet below that worked in EB Build 1.16:
// Derived from code in https://developers.arcgis.com/experience-builder/sample-code/widgets/control-the-widget-state/
const expandTableWidget = (layer): void => {
// This magic statement expands the table container, if it's not already expanded.
getAppStore().dispatch(
appActions.widgetStatePropChange(
props.config.tableContainerWidgetID, // "widget_22",
"collapse",
true // Yeah, this really does need to be True, not False!
)
);
// And this magic statement activates/shows the selected table in the table widget.
getAppStore().dispatch(
appActions.widgetStatePropChange(
props.config.tableWidgetID, // "widget_23",
"dataActionActiveObj",
{ activeTabId: layer.id, dataActionTable: true } // dataSourceId
)
);
};