Query widget doesn't render the filter result

2300
7
04-12-2013 11:03 AM
JulieYuan
New Contributor II
I have configured a Query widget on map service, filter by "category".
It can do a query, get result in the query widget. But it cannot render the result set on a graphics layer

I check the sample, it renders the filter result on the map.
http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-query.xml

My Query Widget xml file. What i missed to render the result on map?  Thanks.
<?xml version="1.0" ?>
<configuration>
    <layer>http://testserver/arcgis/rest/services/Testing/TestReportAll/MapServer/0</layer>
    <query>1=1</query>
    <titlefield>category</titlefield>
    <linkfield/>
    <refreshrate/>
    <zoomscale>50000</zoomscale>
    <shareresults>true</shareresults>
    <orderbyfields>event_number</orderbyfields>
    <fields all="false">
        <field name="event_number" alias="occ_number"/>
        <field name="category" alias="category"/>
       </fields>
     <filterfield>
        <name>category</name>
        <alias>Filter by category #</alias>
     </filterfield>
</configuration>
Tags (2)
0 Kudos
7 Replies
GisUser13
New Contributor II
I am having the same problem on my end.  I can get the widget to filter the results in my table and zoom to the filtered selection, but it shows the other data.  Currently it is working like a search function rather than a filter function.  I am trying to achieve the below ESRI example

http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-query.xml
0 Kudos
AnthonyGiles
Frequent Contributor
Julie

If you are using a 10.1 server the render will be provided by the service itself so for the example below it is using this layer that has its own renderer:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/...

If you want to over ride this with your own renderer or you are using a 9.3.1 server you need to specify your own symbology:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Query_widget_tags/01m30000000t0...


Cassie

When the widget is first opened it will show all the results as the query tag is set to 1=1 (return everything). It is only when you type something into the filter box and select filter that the results will br narrowed down

Regards

Anthony


I have configured a Query widget on map service, filter by "category".
It can do a query, get result in the query widget. But it cannot render the result set on a graphics layer

I check the sample, it renders the filter result on the map.
http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=apps/config-query.xml

My Query Widget xml file. What i missed to render the result on map?  Thanks.
<?xml version="1.0" ?>
<configuration>
    <layer>http://testserver/arcgis/rest/services/Testing/TestReportAll/MapServer/0</layer>
    <query>1=1</query>
    <titlefield>category</titlefield>
    <linkfield/>
    <refreshrate/>
    <zoomscale>50000</zoomscale>
    <shareresults>true</shareresults>
    <orderbyfields>event_number</orderbyfields>
    <fields all="false">
        <field name="event_number" alias="occ_number"/>
        <field name="category" alias="category"/>
       </fields>
     <filterfield>
        <name>category</name>
        <alias>Filter by category #</alias>
     </filterfield>
</configuration>
0 Kudos
GisUser13
New Contributor II
Thank you for getting back to me Anthony. 
Yes, that is correct, when I first choose my query I get all the results, and after I choose to filter, my drop down menu only gives me my query result. 
But what I am also trying to do is only show the polygons of my filtered results on the map, with no other polygons.  Similarly to how the images below are.  The first image shows all the police station points on the map and the second image shows only the police station filtered on the map. 

So far, I am only able to get my drop down menu to filter but not my polygons too.

[ATTACH=CONFIG]28201[/ATTACH]
[ATTACH=CONFIG]28202[/ATTACH]

Here what I am using:

<?xml version="1.0" ?>
<configuration>
<layer>http://mis-esridb:6080/arcgis/rest/services/INFOR_GIS_PointLinking/MapServer/16</layer>
<query/>
<titlefield>RANCH</titlefield>
<linkfield/>
<refreshrate/>
<zoomscale/>
<shareresults>false</shareresults>
<orderbyfields>RANCH ASC</orderbyfields>
<fields all="false">
<field name="RANCH"/>
</fields>
<filterfield>
<name>RANCH</name>
<alias>Filter by Ranch </alias>
</filterfield>
</configuration>

Thanks
Cassie
0 Kudos
AnthonyGiles
Frequent Contributor
Cassie,

The only difference is see with your configuration is the starting query. Have you tried the following:

<?xml version="1.0" ?>
<configuration>
<layer>http://mis-esridb:6080/arcgis/rest/services/INFOR_GIS_PointLinking/MapServer/16</layer>
<query>1=1</query>
<titlefield>RANCH</titlefield>
<linkfield/>
<refreshrate/>
<zoomscale/>
<shareresults>false</shareresults>
<orderbyfields>RANCH ASC</orderbyfields>
<fields all="false">
<field name="RANCH"/>
</fields>
<filterfield>
<name>RANCH</name>
<alias>Filter by Ranch </alias>
</filterfield>
</configuration>

Regards

Anthony
0 Kudos
GisUser13
New Contributor II
Thank you Anthony!  and Yes, that did work. I think I realize what the issue is, in addition to this query, I have layers turned on.  The filter is working, I just need to turn off the background data for it to visually filter properly.

Thank you for your help
0 Kudos
JeffMihalik
New Contributor
Antony,

I have the query widget set to open when my map service opens (a subset of parcels for my area of interest) and it displays a list of parcel owners in asc order..so that works great..The user can scroll the list, find a parcel owner of interest, then zoom to that parcel...

I was wondering where I can find the line of code that controls the open event, as I want the widget and list to open (as it now does) but not select all the corresponding parcels when it opens.. is this possible? I'm assuming its somewhere in the querywidget.mxml but I do not want to hack around in there without some quidance. Thanks for any help.

Jeff
0 Kudos
JulieYuan
New Contributor II
Anthony,
Thank you very much for your reply.
We are using 10.1 Server. I am using the "Unique Value Renderer", will try to use the layer's own renderer.


Julie

Julie

If you are using a 10.1 server the render will be provided by the service itself so for the example below it is using this layer that has its own renderer:

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/...

If you want to over ride this with your own renderer or you are using a 9.3.1 server you need to specify your own symbology:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Query_widget_tags/01m30000000t0...


Regards

Anthony
0 Kudos