How can I make my widget appear in page without clicking the icon to launch?

1087
6
11-17-2016 10:49 AM
RolandoFlorez
New Contributor III

I need that my widget appear in the page at begin the application, like scale bar, coordinate or search widget.

What is the configuration that I have to do?

0 Kudos
6 Replies
Drew
by
Occasional Contributor III

If your manifest.json file you need to set "inPanel": false

Then you need to add it to the applications config under the 'widgetOnScreen' section

0 Kudos
RolandoFlorez
New Contributor III

Yeah Andrew, but, which "config.json" file?

0 Kudos
Drew
by
Occasional Contributor III

Sorry ** CORRECTION **
You need to add it to the applications config.json (widgetOnScreen) file in your stemapp

RolandoFlorez
New Contributor III

Like you've said, by hand, I put the widget, but It keeps showing me the icon to launch the widget, not the widget properly.

Sorry for the inconvenience.

0 Kudos
Drew
by
Occasional Contributor III

Are you adding the widget to the 'widgetOnScreen' section in the config file?

0 Kudos
JordanKing3
New Contributor III

Sounds like you actually want to launch a widget from the widget pool when the application starts, not just have an on-screen widget (e.g. Scalebar, Search)?

As long as the widget has been added correctly to the config.json file, within the root folder of the application, and the actual widget exists within the widget folder, you might be able to call:

PanelManager.getInstance().openPanel('widgetid')

You would need to call this somewhere after all the widgets have finished loading and also somewhere where the PanelManager is instantiated and available. Potentially somewhere within the init.js file after the loadResources() function has finished executing. Not sure exactly where, might take some trial and error.

0 Kudos