Selecting Features from DataSource

3487
10
Jump to solution
02-09-2024 05:09 PM
Labels (2)
PartyPelican
Regular Contributor

Hello!

I am trying to create a widget that can select multiple layers based on a click event and show them in a series of tabs with a feature widget inside, however, I am new to development in experience builder. Currently I establish a click event listener on the map view and when the view is clicked, I query each FeatureLayerDataSource that is saved in state. I want to be able to select those results on the map but when I use datasource.selectRecordsByIds() with the object ids of the results, I dont see any highlighting on the map, and it appears as though my component renders twice. Its not clear to me why but you can see in the console that the tabs for each datasource gets rendered twice upon the click. This only happens when I use that selectRecordsByIds() method. Does anyone have any advice on how I can fix this or what I can do to make this work properly?

I appreciate any feedback, thank you.

PartyPelican_0-1707527257062.png

 

 

10 Replies
RachappaBellappa1
Emerging Contributor

Please check the screenshot above, i have a JSON object and i am binding that to featuredatalayersource by passing objectids. In Network i can see it's doing query call and also in select widget it shows selected features count but features are not highlighted

0 Kudos