Select to view content in your preferred language

Passing Parameter to Flex Viewer

24179
114
01-14-2011 03:46 AM
CurtNielsen
Occasional Contributor
I would like to pass a parameter, parcel id, to flex viewer and have the map pan to that location. I have modified the Search widget to use a layer that we can search by parcel ID. Just want the same capability if I pass a parameter, paracle ID, to http://mynode/FlexViewer. Maybe something like http://mynode/FlexViewer?request=widget&version=2.1&WidgetName=Search&ParcelID=1234

Thank you!
Tags (2)
0 Kudos
114 Replies
MarkYerington
Frequent Contributor
I am using Flexviewer 2.3.1.  What I have found is if I put the mapLoadComplete function in the layerLoadComplete it will run the query but the clock cursor keeps spinning and does not change back to the arrow cursor.  If I put in the mapLoadComplete function it will not run the query.  I put a breakpoint at the start of the queryFromURL and it never gets there when using the mapLoadComplete function. Any suggestions would be great.
Thanks
Mark
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mark,

   Do you have anything calling the mapLoadComplete function?
0 Kudos
MarkYerington
Frequent Contributor
Yes I put it where Nathan said, and it gets through the mapLoadComplete function but never runs the query it just sits there and spins the clock.  I put the break points in the query function but it never gets to them.  As I step through the mapLoadComplete it looks like it should be running the query but it doesn't seem to be.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mark,

   I am not sure where you are going wrong. Maybe you should post some of your code.
0 Kudos
MarkYerington
Frequent Contributor
Here is my MapManager.mxml.  I have not modified anything in the search widget, and it runs the query if I put the mapLoadComplete function contents in the layerLoadComplete function so I would think that it has to be something in this mxml
0 Kudos
MarkYerington
Frequent Contributor
While stepping through the code, set up the way that previous posts state I would say the queryFromURL is being called prior to the Search Widget loading.  The mapLoadComplete is called right after the maps load up not the widgets.  Would anyone have any ideas why this would be happening this way.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mark,

   Do you have the SearchWidget Preloaded? If not then that is an issue.
0 Kudos
MarkYerington
Frequent Contributor
Yes it is preloaded.  The problem is when the application is loading up it will call the map load complete function before the widget is actually showing on the application.  The search widget, navigation, and headercontroller widgets all load after the mapLoadComplete function is called.  The layerLoadComplete function is called everytime something is added to the map, so it will work in this, but that means that the query is called everytime another widget is turned on, so it keeps zooming back to the searched url.
0 Kudos
MarkYerington
Frequent Contributor
This is very odd, when I came in friday it ran the code fine to find the parcel on the first debug run, and it did the same thing today.  Every other time I run the code it finds nothing.  Is this something that anyone has seen.  Also I exported a release build and it just sits and spins the clock.
0 Kudos
NathanEnge
Esri Contributor
I'm experiencing the same issue, but only on certain browsers and OS. On my development machine as well as any other machine that is running XP and IE 8, it works fine. but I find that with anybody running vista and IE9, they need to turn on compatibility load, then hit the refresh button. I also find that it will work in firefox but will bail with chrome.
0 Kudos