Select to view content in your preferred language

Call a function on eSearch from a popup button click

996
4
Jump to solution
09-18-2013 05:54 AM
MayJeff
Deactivated User
I created an extra button on popup infowindow (PopUpRendererSkin.mxml).  How do you call a getLocateGra() function on eSearch when user click a button on popup infowindow instead of click the icon on eSearch widget?

Thanks.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
May Jeff,

   If that widget has to be opened first then it is not ready to receive the getLocateGra function request. You will have to figure out a way to delay the getLocateGra function request until the widget is opened and ready. This is not something simple that I have time to provide an example for but it can be accomplished by understanding the widget communication model. Here is a link to my Widget Communication Explained.pdf

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
May Jeff,

   Put this code in the buttons click handler. Of course you will have to change the getLocateGra function from private to public for this to work:

                var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("Enhanced Search");
                var bWidget2:IBaseWidget;
                bWidget2 = ViewerContainer.getInstance().widgetManager.getWidget(id, false);
                var eSearch:* = bWidget2;
                eSearch.getLocateGra();
0 Kudos
MayJeff
Deactivated User
Thank you so much for the code but I have some questions about the click button handler on my popup infowindow.
When first click, it will open esearch widget but you have to click again in order to call getLocateGra() function to highlight a polygon. Is possible when you click the button, it will call getLocateGra() function for highlighting a polygon?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
May Jeff,

   If that widget has to be opened first then it is not ready to receive the getLocateGra function request. You will have to figure out a way to delay the getLocateGra function request until the widget is opened and ready. This is not something simple that I have time to provide an example for but it can be accomplished by understanding the widget communication model. Here is a link to my Widget Communication Explained.pdf
0 Kudos
MayJeff
Deactivated User
Thank you very much.
0 Kudos