Select to view content in your preferred language

open widgets from widget controller programmatically

157
2
07-01-2025 10:08 AM
WalaZargouni
Emerging Contributor

Hello everyone, i have a question concerning the usage of dispatched state props in data actions.
Can i dispatch a state prop to a widget by its widgetId and read that value in the concerned widget itself without opening the widget ? (when in a widget controller)

This dispatched state prop is used to conditionnally show a FloatingPanel on the map, but this FloatingPanel is placed inside a widget, so what happens is whenever i activate the data action and the widget is still closed nothing happens.

0 Kudos
2 Replies
Allen_Zhang
Frequent Contributor

A widget in a controller will not load itself before it's opened(performance consideration), so a never-opened widget can't react to the dispatched stat prop.

Once it is opened, I think the dispatching will work.

0 Kudos
JeffreyThompson2
MVP Frequent Contributor

As @Allen_Zhang said, a Widget in a Widget Controller will not be able to respond until it is first opened. A workaround may be to design your Widget to only render a Button when in an inactive state and open up to reveal its full functionality when the Button is pressed or it receives a Message from another Widget.

GIS Developer
City of Arlington, Texas
0 Kudos