Select to view content in your preferred language

Pass URL parameters in sample viewer

7794
49
11-03-2010 08:08 AM
AaronNash
Deactivated User
There was a previous thread on the old forum to pass search parameters into a url string,
http://forums.esri.com/Thread.asp?c=158&f=2421&t=294907&mc=104#msgid925229
I would like to see if anyone has accomplished this for the new viewer. I have a non-spatial flex application that runs a query on a ArcServer service and returns the results into a datagrid, I then have a button that exports the results into a pdf report. I would like to have another function that takes a value from the datagrid, populates it into a URL string that opens a new browser and zooms to that selected feature. 

thanks,
  Aaron
Tags (2)
0 Kudos
49 Replies
RobertScheitlin__GISP
MVP Emeritus
Anshul,

   Please do not post the same question to multiple threads. This question is being answered here:

http://forums.arcgis.com/threads/21180-Passing-Parameter-to-Flex-Viewer
0 Kudos
MGSethe
Deactivated User
Is this application running on your local computer? I have IIS installed on my local machine and created a virtual directory that points to the bin-debug folder of my project, I changed the output folder URL and the run/debug setting URL path to launch. So when I am testing on my local computer the application launches in a url which is http://localhost/NewViewer2.4/index.html, I can then add the search parameters http://localhost/NewViewer2.4/index.html?search=08-0025-00009 and if everything is configured correctly the search is executed. With the 2.4 version, as long as the search was configured correctly the URL string will work


Aaron and Robert , i finally got it to work, i just want to thank you all for making this code availabe to the forum, you really saved my life.

Again thank you a million times.
0 Kudos
MGSethe
Deactivated User
Is this application running on your local computer? I have IIS installed on my local machine and created a virtual directory that points to the bin-debug folder of my project, I changed the output folder URL and the run/debug setting URL path to launch. So when I am testing on my local computer the application launches in a url which is   http://localhost/NewViewer2.4/index.html, I can then add the search parameters   http://localhost/NewViewer2.4/index.html?search=08-0025-00009 and if everything is configured correctly the search is executed. With the 2.4 version, as long as the search was configured correctly the URL string will work



Aaron, maybe you can help me on this one, i can not get the Images to load on my report.
I have made my changes as follows, referring to the code that you supplied.

<mx:VBox id="vbox0" horizontalAlign="center" visible="false">
[U]<mx:TextInput id="buildingtext" text="http://madikana/Chdmgis/{resultsGrid.selectedItem.ShortFileName}"/> <mx:Label id="urltext" text="http://madikana/Chdmgis/gisindex.html?search={resultsGrid.selectedItem.CompNme}"/>
<mx:TextInput id="buildingtexturl" text="{bldtxt}.jpg"/>
<mx:Image id="building"/>
<mx:TextInput id="imagetext" text="http://madikana/Chdmgis/Photography/{resultsGrid.selectedItem.image_path}"/> <mx:TextInput id="imagetexturl" text="{urltxt}"/>
<mx:Image id="image1" width="320" height="240"/>
</mx:VBox>

Are you able to have a look at this and tell me where i went wrong, i have created image_path field in my data attributes to store the photograph names.

How is the path for the photos formated in the attributes?

Please help.
0 Kudos
AaronNash
Deactivated User
Golden,

this is probably a new thread, but I will try to help you here. A good test to see if the URL is formatted correctly is try and access it from your browser, if you can get the image to show in a browser then you know what the URL should be. In my application I used textinput boxes to check on the URL format as it was being passed through the different stages of construction. The database that contained the image_path field had back slashes not forward slashes, and had extra spaces on the end. So to follow my workflow the first text input box imagetext would show the URL being http://gis.vernon-ct.gov/image/11000\11347.jpg (it would have like 10 extra spaces on the end also). Not sure how much of my code I gave you, but I had an itemclick function that reformatted the URL, and dumped the text in imagetexturl. The end result would be http://gis.vernon-ct.gov/image/11000/11347.jpg . If you copy and paste this text into browser the image will show up. I also created a virtual directory in IIS that pointed to my image folder. So to start you need to make sure you have a working URL string and then reconstruct that string in flashbuilder.

Aaron
0 Kudos
MGSethe
Deactivated User
Golden,

this is probably a new thread, but I will try to help you here. A good test to see if the URL is formatted correctly is try and access it from your browser, if you can get the image to show in a browser then you know what the URL should be. In my application I used textinput boxes to check on the URL format as it was being passed through the different stages of construction. The database that contained the image_path field had back slashes not forward slashes, and had extra spaces on the end. So to follow my workflow the first text input box imagetext would show the URL being http://gis.vernon-ct.gov/image/11000\11347.jpg (it would have like 10 extra spaces on the end also). Not sure how much of my code I gave you, but I had an itemclick function that reformatted the URL, and dumped the text in imagetexturl. The end result would be http://gis.vernon-ct.gov/image/11000/11347.jpg . If you copy and paste this text into browser the image will show up. I also created a virtual directory in IIS that pointed to my image folder. So to start you need to make sure you have a working URL string and then reconstruct that string in flashbuilder.

Aaron


Thanks Aaron for replying, i do not have the itemclick function on the code that i have,I have tried to reformat the URL string. I can access the image on my virtual director with no problems,I just can not get the image loaded from the query. Maybe i am missing something, Attched is the code that i have ro check for me if i am on the right direction.
0 Kudos
AaronNash
Deactivated User
your code did not attach
0 Kudos
MGSethe
Deactivated User
Golden,

this is probably a new thread, but I will try to help you here. A good test to see if the URL is formatted correctly is try and access it from your browser, if you can get the image to show in a browser then you know what the URL should be. In my application I used textinput boxes to check on the URL format as it was being passed through the different stages of construction. The database that contained the image_path field had back slashes not forward slashes, and had extra spaces on the end. So to follow my workflow the first text input box imagetext would show the URL being http://gis.vernon-ct.gov/image/11000\11347.jpg (it would have like 10 extra spaces on the end also). Not sure how much of my code I gave you, but I had an itemclick function that reformatted the URL, and dumped the text in imagetexturl. The end result would be http://gis.vernon-ct.gov/image/11000/11347.jpg . If you copy and paste this text into browser the image will show up. I also created a virtual directory in IIS that pointed to my image folder. So to start you need to make sure you have a working URL string and then reconstruct that string in flashbuilder.

Aaron


Thanks Aaron for replying, i do not have the itemclick function on the code that i have,I have tried to reformat the URL string. I can access the image on my virtual director with no problems,I just can not get the image loaded from the query. Maybe i am missing something, Attched is the code that i have ro check for me if i am on the right direction.
0 Kudos
AaronNash
Deactivated User
the doc was empty, try loading it into a txt file
0 Kudos
MGSethe
Deactivated User
the doc was empty, try loading it into a txt file


My apology, here is the correct one
0 Kudos
MGSethe
Deactivated User
the doc was empty, try loading it into a txt file


Hello Aaron, thanks again for looking at my problem, It was my mistake, forgot to include the "image_path" in the output field for the query.

Got it working this morning,

Thanks again for the  code.
0 Kudos