Select to view content in your preferred language

Pass URL parameters in sample viewer

7754
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
SandraPanicucci
Deactivated User
This is what I have in ViewerContainer:
I came to the conclusion this was where the error is but I can't see anything wrong and I've been over it so often I can't see straight anymore.

public function getWidgetId(widgetLabel:String):Number
   {
    var id:Number;
    for (var i:Number = 0; i < _configData.widgets.length; i++)
    {
     if (_configData.widgets.label == widgetLabel)
      id = _configData.widgets.id;
    }
    return id;
   }
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sandra,

You need a couple of more thing in your ViewerContainer.mxml code (I forgot them in my documentation too).

//Add this private var to the top with other private vars
private var _configData:ConfigData;

//Add this line to the postConfigHandler function
_configData = configData;
//After this line var configData:ConfigData = event.data as ConfigData;
0 Kudos
SandraPanicucci
Deactivated User
The following is the one I was missing. Still doesn't zoom but it is finding the BMPID and placing an icon. Thank You very much.

Sandra,

//Add this line to the postConfigHandler function
_configData = configData;
//After this line var configData:ConfigData = event.data as ConfigData;
0 Kudos
MGSethe
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


Hello Aaron
Firstly, i just want to thank you for sharing the code with us, I have been following the thread and trying to use your code to achieve exacly what you want here, I see you got it solved, using the Enhansed search widget, could you please share the light with  me as i am battling to get the Search zoom to the results, If possible can i refer to your Widgetmanager and the SearchWidget? I am using the 2.4 API and battling to migrate the code i put together from different threads.

Your assistance is highly appreciated.
0 Kudos
AaronNash
Deactivated User
Golden,

If you are using the 2.4 api, then I would use Robert's new enhanced search widget, you can find it HERE. He was able to integrate all the code needed to accomplish exactly what was done in this forum, everything is outlined in the documentation included in the download. I am using the latest version and it was easy to configure. If you do use Robert's widget make sure you rate it on the download page

Aaron
0 Kudos
MGSethe
Deactivated User
Golden,

If you are using the 2.4 api, then I would use Robert's new enhanced search widget, you can find it HERE. He was able to integrate all the code needed to accomplish exactly what was done in this forum, everything is outlined in the documentation included in the download. I am using the latest version and it was easy to configure. If you do use Robert's widget make sure you rate it on the download page

Aaron


Thanks for the quick reply, did you make any changes to the  Widgetmager or the Viewercontainer?

I have been trying to get it wotking but unsucessfull?

what other steps did you follow?


Golden
0 Kudos
AaronNash
Deactivated User
I followed the instructions in the documentation. Are you using the enhanced search widget 2.4? If so there are no code changes to the flexviewer, everything should be configured from the search widget xml. What URL string are you using to try and search?

Aaron
0 Kudos
MGSethe
Deactivated User
I followed the instructions in the documentation. Are you using the enhanced search widget 2.4? If so there are no code changes to the flexviewer, everything should be configured from the search widget xml. What URL string are you using to try and search?

Aaron


Yes, i am using 2.4, i am trying to searh the following URL, http://madikana/Chdmgis/bin-debug/index.html?search=Reinbron.

To get the additional parameters, i ended up  adding the following, to the "URLTEXT" text="http://madikana/Chdmgis/bin-debug/index.html?search={resultsGrid.selectedItem.OfficialNme}&amp;slayer=0&amp;exprnum=0&amp;showdatagid=true".

Thanks for looking at that.
0 Kudos
AaronNash
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
0 Kudos
AnshulMantri1
Emerging Contributor
Dear 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