Select to view content in your preferred language

Featured Layer Search Question

715
2
12-12-2012 07:22 AM
TimRingwood
New Contributor
I found this example: http://resources.arcgis.com/en/help/flex-api/samples/index.html#//01nq00000025000000

Which is close to what I need to do, except instead of the user entering the data it will be passed via a URL.

When I add the example to my code and just call doSearch() nothing happens. But then I don't see where events are being set so that when the expression is changed the start will be called.

Any pointers how to get search a featured layer without user input?

Tim
Tags (2)
0 Kudos
2 Replies
RhettZufelt
MVP Notable Contributor
Have you looked at the eSearchWidget url query option?

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

click the open button to view the example site.  will automatically come up with a feature search as defined in the xml and the url.

R_
0 Kudos
TimRingwood
New Contributor
I knew there was a simple answer, but people sure love the fancy ones. In end I all I needed was:

                           var featureLayer:FeatureLayer = new FeatureLayer("http://mygisserver.com/ArcGIS/rest/services/MyService/MapServer/0");
    featureLayer.outFields = [ '*' ];
    featureLayer.alpha = 0.3;
    featureLayer.definitionExpression = "ID " + x; // x passed in via the URL
    featureLayer.visible = true;
    map.addLayer(featureLayer);
0 Kudos