Select to view content in your preferred language

Dynamically changing widget data source (ExB Developer Edition 1.13)

340
3
03-07-2024 10:44 AM
chapmunnhsc
New Contributor III

ExB developer edition version 1.13.

I'm trying to figure out if it is possible to dynamically change an out of the box widgets data source using either the configuration menu or through some type of action from a custom widget.

As an example, I'd like to configure a ExB app that has a:
 
  • A Map configured using the drag and drop interface. The consumed Web Map will have a single feature layer.
  • A custom widget that will create a client-side feature layer based on the Web Map feature layer and add it to the Map.
  • A dynamic text widget configured using the drag and drop interface.
 

Would it be possible, using the widget setting configuration screen, to point the dynamic text at the feature layer when it loads then point it at the client-side feature layer when it is created?

Would switching the dynamic text data source have to be done using a Data Action via the custom widget?

Thank you

0 Kudos
3 Replies
JeffreyThompson2
MVP Regular Contributor

Do your widgets need to be reusable? As in, you can drop them into any project and they will work as expected. Or can they be designed specifically for your application?

If they don't need to be reusable, I suggest building your own custom Text Widget from scratch. Use the reactiveUtils to connect to your server data and show the results and another reactiveUtils handle to watch for the creation of the new layer. When the new layer is created destroy the reactiveUtils handle watching the server-side data and create a new reactiveUtils handle for the client-side data.

GIS Developer
City of Arlington, Texas
chapmunnhsc
New Contributor III

@JeffreyThompson2 the custom widget/s do not need to reusable, application specific use cases. Client wants to use as many out of the box components as possible. My initial impression was to do something similar. Thanks for the response.

0 Kudos
chapmunnhsc
New Contributor III

@JillianStanford , any idea about this one?

0 Kudos