Open widget in Widget Controller

1248
6
Jump to solution
09-29-2021 12:46 AM
MatejKutik
New Contributor II

Hello everyone!

 

I'm trying to programmatically open widget that is in "Widget Controller".

I have tried

WidgetManager.getInstance().openWidget(widgetId)

and

const action = appActions.openWidget(widgetId);
getAppStore().dispatch(action);

 

Both attempts opened the widget, but only when the widget had been previously opened.

Is there a way how to open widget that was not yet opened?

 

I'm using ArcGIS Experience Builder Developer Edition version 1.5.

 

Thanks, Matěj. 

1 Solution

Accepted Solutions
6 Replies
PhilLarkin1
Occasional Contributor III

I'd also like to know of a solution. I have a widget I would like to have open when the app loads. 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

This is something that was not possible in versions before 1.6.

https://developers.arcgis.com/experience-builder/sample-code/widgets/control-the-widget-state/

 

PhilLarkin1
Occasional Contributor III

Awesome! Thanks for the notice. Did 1.6 come out this week?

Robert do you know how we would tell the widget to open at a certain position within a map view?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Not have not looked into that yet

0 Kudos
PhilLarkin1
Occasional Contributor III

Hi @MatejKutik 

Were you able to use the sample code to open the widget as the application loaded? You mentioned your sample worked but only if the Widget had been opened at least once.

0 Kudos
AnnaGoldenstein
New Contributor

In 1.13 you can load widget and then open it:

 

const widgetManager = WidgetManager.getInstance();
widgetManager.loadWidgetClass(widgetId);
widgetManager.openWidget(widgetId);
0 Kudos