Passing Parameter to Flex Viewer

16779
114
01-14-2011 03:46 AM
CurtNielsen
New Contributor III
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
AnshulMantri1
New Contributor
Robert,

My Query is opening a simple widget by URL.

what i m trying is -

http://Server/index.html?widgetId=18

When i run the application, no widget is open, Can u please suggest how can we open a widget by placing a call in the URL after index.html?"..."

Regards
Anshul
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anshul,

   Before I point you down the road of making changes to the source code let me make sure you are aware of the ability that is built into Flex Viewer for loading a particular config file from the url. Basically in your scenario you could have multiple config files on your server. Take for example this url of mine that loads the viewer with my eSearch widget preloaded.

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-eSearch.xml

and the same exact viewer using a different config file to preload my TOC Widget.

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-toc.xml
0 Kudos
AnshulMantri1
New Contributor
Sorry, was bit confused with the threads going on...
Now how can i achieve as below:

So wat do i have to add in my config for achieving say for eg :

http://Server/index.html?identify

Where i don't want the identify widget to have this preload="open".

Because my application will be calling this widget based on need basis. So how can i achieve this.

Regards
Anshul
0 Kudos
AnshulMantri1
New Contributor
So wat do i have to add in my config for achieving say for eg :

http://Server/index.html?identify

Where i don't want the identify widget to have this preload="open".

Because my application will be calling this widget based on need basis. So how can i achieve this.

Regards
Anshul










Anshul,

   Before I point you down the road of making changes to the source code let me make sure you are aware of the ability that is built into Flex Viewer for loading a particular config file from the url. Basically in your scenario you could have multiple config files on your server. Take for example this url of mine that loads the viewer with my eSearch widget preloaded.

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-eSearch.xml

and the same exact viewer using a different config file to preload my TOC Widget.

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-toc.xml
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anshul,

   You have me a little confused now... Say you want to open the viewer with the identify widget opened then you would have a url like this:

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-identify.xml
and in the config-identify.xml it would have preload="open" but if you did not want the identify widget opened then you would not use that particular config file (config-identify.xml), you would use another.
0 Kudos
AnshulMantri1
New Contributor
OK for this URL to work
http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-identify.xml

Wat would u add in the config file. As i am accessing the same
http://servername/index.html?config=config-MyWidgetName.xml

but getting the attached error.
My objective is :

when i click or place a call from any Html page i will send a URL with

http://servername/index.html?... here i will have to add a parameter to open a widget of my choice.




Anshul,

   You have me a little confused now... Say you want to open the viewer with the identify widget opened then you would have a url like this:

http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-identify.xml
and in the config-identify.xml it would have preload="open" but if you did not want the identify widget opened then you would not use that particular config file (config-identify.xml), you would use another.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anshul,

  OK silly question but do you actually have a config-MyWidgetName.xml file in your Flex Viewer??? If you have not yet created one than that  is your issue.
0 Kudos
AnshulMantri1
New Contributor
I have only two xml i.e

Config.xml and Config-all.xml




Anshul,

  OK silly question but do you actually have a config-MyWidgetName.xml file in your Flex Viewer??? If you have not yet created one than that  is your issue.
0 Kudos
AnshulMantri1
New Contributor
I have only two xml i.e

Config.xml and Config-all.xml


If i need to have config-MyWidgetName.xml then in that case wat shud i include in that..?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anshul,

   All the same stuff you have in your Config.xml but make sure the widget that you are wanting to load is set to preload="open".
0 Kudos