Select to view content in your preferred language

Run Widget on map Click

951
4
10-05-2011 09:11 AM
FaizanTayyab
Deactivated User
Does anybody know how to run a widget on map mouse click.

Thanks
Tags (2)
0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Faizan,

    Try this:

AppEvent.dispatch(AppEvent.WIDGET_RUN, id);
0 Kudos
FaizanTayyab
Deactivated User
Thanks Robert
0 Kudos
FaizanTayyab
Deactivated User
I have added the code in the map click event, however it throws an error on focus widget function. It seems the map click event is fired again and hence the widget run command executes again. How to stop the widget command from running once the widget has run.

Basically i need the identify widget to run (automatically open) whenever the user click on the map.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Faizan,

   If you are using Flex Viewer 2.4 than you could use this to determine if the widget is already loaded.

ViewerContainer.getInstance().widgetManager.getAllLoadedWidgetIds()
This returns an array of widget ids that you can check if your widgets id is in the array and if it is don't do the Run.
0 Kudos