I've managed to successfully create and add a data source to map, preserving its rendering and giving it DataSource capabilities (add to table, select tool, etc.). However, those DataSource capabilities are lost as soon as the layer is reordered in the layer list widget. My FeatureLayer and DataSource are defined as follows:
Unsure why reordering removes DataSource functionality, I assume it is something to do with the layerId property, but I cannot find a sensible configuration of that property that makes it work, so it may not be that at all.
This post is a follow-up on runtime FeatureLayer / DataSource creation, for more prior context as to how I got here, reference this post:
Solved! Go to Solution.
I did a little testing. This appears to be a bug in Experience Builder 1.15. Using an application built in Developer Edition 1.14, runtime added layers re-order without issue, but using the version in ArcGIS Online, I see the behavior you describe.
Yes, we will take a look at this issue. Thanks for bringing it up @jwilner_amica @JeffreyThompson2
This functionality issue is also present in layers added to the map by Esri's 'Add Data' widget, but it is NOT present in layers that exist within a Web Map already. As such, it seems to be something unique to adding during runtime.
I did a little testing. This appears to be a bug in Experience Builder 1.15. Using an application built in Developer Edition 1.14, runtime added layers re-order without issue, but using the version in ArcGIS Online, I see the behavior you describe.
Interesting! Hopefully ESRI sees this and can get around to patching it. Thank you for finding that, I've only done work in 1.15.
This is actually a pretty big bug. I'm going to tag a couple developers, so they can look into it further.
@TonghuiMing @WeiYing1 @YueyangLi
Yes, we will take a look at this issue. Thanks for bringing it up @jwilner_amica @JeffreyThompson2
I did open a support case for this in order to log a bug. Case #03730665. I have not heard back if a bug was actually created yet.
It looks like this is caused by a corner case when you try to reorder layers in a map-layers widget that connects to a map widget without a web map. We will dig into it, thanks.
Bug has been created for this issue. Bug number: BUG-000171121