Select to view content in your preferred language

Passing Parameter to Flex Viewer

24175
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
CarolineCochrane
Deactivated User
Marc - thanks a lot for your quick response. I will try thinking about this more and see if I can get it working.

Thanks again,

Caroline
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Caroline,

   You will probably want to take a look at the Enhanced Search Widget as it allows for URL searches to be performed based on any SQL criteria defined in the SearchWidget.xml.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e
0 Kudos
CarolineCochrane
Deactivated User
thanks Robert - i tried compiling this but as Im using viewer src 2.3.1 i have acouple of errors. is your eSearch only working at 2.4 onwards?
Sorry to ask if this is already noted somewhere!
thanks again,
caroline
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Caroline,

   The source code is written for Flex Viewer 2.4 and higher only but to down grade the code would only involve changing a few lines:
AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
needs to be:
ViewerContainer.addEventListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);


In both the SearchWidget.mxml and the SearchWidgetFixedDG.mxml

I think that is it, but don't quote me on that.
0 Kudos
CarolineCochrane
Deactivated User
Hi Robert - and thanks a million for the code change info. This removed the error. One more (hopefully small) thing if you have a second...the com.esri.ags.skins.supportClasses.PopUpText; is not included in a 2.3.1 project. Sorry to ask but do you know how to get this into my project? I have downloaded the 2.4 src but having trouble trying to copy as this does not seem to be permitted.

Thanks in advance!

Caroline
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Caroline,

   Try commenting out this line:

popUpRenderer.setStyle("skinClass", widgets.eSearch.PopUpRendererSkin);


In the showHighlight function.
0 Kudos
CarolineCochrane
Deactivated User
thanks so very much. problem solved! 🙂

Caroline
0 Kudos
NathanEnge
Esri Contributor
Hey there, having a bit of an issue. It seems like the query works:
http://www.mapservices.ca/aditya/index.html?q=Westbank/Westbank!7&v=MAPIT.548.2

however, the selection zoom and selected graphics are placed in the wrong place in the world.
The REST url for Mapservice number 7 is here:
http://www.mapservices.ca/ArcGIS/rest/services/Westbank/Westbank/MapServer/7

If you go to just the application itself you will see that it is nowhere near the 1 degree parallels.

Whats happening here?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nathan,

  Why are you trying it this old way? The eSearch Widget has this built in now with not changes to the map manager code.
0 Kudos
NathanEnge
Esri Contributor
Nathan,

Why are you trying it this old way? The eSearch Widget has this built in now with not changes to the map manager code.


some widgets are not moved to 2.4 yet, so this particular app deployment is still in 2.3 untill i fix the code for some of the widget it uses...

i figured out the problem is specific to that layer. all other layers query fine.
0 Kudos