How to open a widget from a controller programmatically ?

2614
2
Jump to solution
10-26-2015 02:44 AM
MathieuVILLEMONT1
Occasional Contributor

Opening a widget from a placeholder can be done using PanelManager's showPanel method. However what if the widget is located in a controller ?

So far the only solution I found is to call the controller's method which open a given widget :

var controller = WidgetManager.getInstance().getWidgetsByName('MyThemeController');

controller.openWidget(widgetConfig);

The problem with this solution is that not every theme controller implement such method.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

Mathieu,

   The only thing I can think of is you will have to develop a function that has a switch case based on the theme, if you are looking for a function that can open a widget irrelevant of the theme in use.

View solution in original post

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

Mathieu,

   The only thing I can think of is you will have to develop a function that has a switch case based on the theme, if you are looking for a function that can open a widget irrelevant of the theme in use.

View solution in original post

0 Kudos
MathieuVILLEMONT1
Occasional Contributor

Yes  so far this seems to be the only solution. The other one being to add a custom method to each theme.

0 Kudos