Open widget in Widget Controller

494
5
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
RobertScheitlin__GISP
MVP Esteemed Contributor
5 Replies
PhilLarkin1
Regular Contributor

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 Esteemed Contributor

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
Regular Contributor

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 Esteemed Contributor

Not have not looked into that yet

0 Kudos
PhilLarkin1
Regular Contributor

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