Select to view content in your preferred language

What does the query widget query?

1686
17
12-09-2010 12:34 PM
RichardHolloway
Emerging Contributor
I am new and trying to figure this out.  You query a service but how do I create the items to be queried within that service?  In ArcMap I can't seem to find what I am looking for.  Can someone point me in the correct direction?
Tags (2)
0 Kudos
17 Replies
RichardHolloway
Emerging Contributor
Yep but I don't see the mxml just the .swf so your probably right.  I did not think I need the source.
0 Kudos
RichardHolloway
Emerging Contributor
Ok so I am looking at the querywidget.mxml but don't see where its stating the webservice or setting the items that are contained within the widget.
0 Kudos
RichardHolloway
Emerging Contributor
Are those features in the layer as objects?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Richard,

   So in the QueryWidget.mxml Line 116
                    queryLayer = configXML.layer;

This is the line that sets a string variable to the mapservice url specified in the xml file. On line 254 that var is used to set the QueryTask. On line 286 the results from the QueryTask are recieved as a featureSet and sent to the createQueryResults function, where they are parsed and QueryResults.as values are set. The QueryResultsItemRenderer than uses those results to display them in the datagroup.

The FeatureSet is:
A set of features with information about their fields, field aliases, geometry type, spatial reference etc. The FeatureSet is returned by QueryTask.execute() and FeatureLayer.queryFeatures() and includes not only the graphics but also the metadata about them.
0 Kudos
RichardHolloway
Emerging Contributor
Ah...there it is. I was looking for something else.  Cool.
0 Kudos
RichardHolloway
Emerging Contributor
Ok asked one of the arcmap guys for some help and got the attributes set up for a layer in my attributes table.  So..for some reason on the query widget I get a invalid URL but the url is valid as a mapservice.  Is that correct? I did notice on the service for the example it says feature layer.  Does that matter?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Richard,

   When you are using query the specific layer of the map service has to be specified.

i.e http://yourserver/arcgis/rest/services/yourservice/2 meaning the 3rd layer of that map service will be queried.
0 Kudos
RichardHolloway
Emerging Contributor
That got it!!  COOL!  Thanks!!
0 Kudos