Select to view content in your preferred language

Programmatically Open Search Widget and do APN Search Based on URL Parameter APN=xxxxxxx

1139
4
Jump to solution
04-25-2022 05:20 PM
BingJing
Regular Contributor

Hi All

When users type in https://mywebsite?APN=xxxxxxx, I need to open on-screen widget "APN/Address Search"(Modified Robert's Enhanced Search), and do the APN search by calling a function defined in this widget.

How do I open the widget if there is APN parameter?  I could retrieve the URL parameter from mapmanager.js or MapUrlParamsHandler.js, but could not figure out how to open widget from either of these two files.

Thank you in advance.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus

@BingJing 

Here is one of the many threads on opening a widget programmatically.

https://community.esri.com/t5/arcgis-web-appbuilder-questions/how-to-open-a-widget-in-a-placeholder/...

 

0 Kudos
BingJing
Regular Contributor

Hi Robert

Thank you so much for always helping out.  It works perfectly.  Can I ask how you  figure out the  number "4"? 
pm.showPanel(this.appConfig.widgetOnScreen.widgets[4]);

I looked at all .json files but have no clue.

 

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

@BingJing 

In your application where is the widget that you trying to open located? for example, in the foldable theme is it in one of the onscreen widget placeholders or in the header controller widget? If it is in the "widgetOnScreen" section then the first widget listed in the array is 0 and second is 1 and so on. There is also the "widgetPool" > "widgets" and it follows the same concept.

 

0 Kudos
BingJing
Regular Contributor

Hi Robert, It is "widgetOnScreen" , thank you for your help. Appreciate you as always. 

0 Kudos