Select to view content in your preferred language

Search Widget Not Selecting Features

2815
6
09-28-2010 01:26 PM
EmilyLaMunyon
Deactivated User
Hello,

I am trying to modify the Search Widget that came with the Sample Flex Viewer 2.0, to search on my own layers. I think I am close, but I continue to get a message that reads: Features selected:0, this happens when I do a graphical as well as text search. My SearchWidget.xml is below. Is there something I am missing for this to work on my rest layers?

Thanks in advance:)

<?xml version="1.0" ?>
<configuration>
    <layers>
        <layer>
            <name>SLCo Trails</name>
            <url>http://gis.slco.org/wwwrest/services/Utah_Trails/Polygons2/MapServer/3></url>
            <expression>Name LIKE'%[value]%'</expression>
            <textsearchlabel>Search by Name:</textsearchlabel>
            <graphicalsearchlabel>Use one of the graphical search tools to select</graphicalsearchlabel>
            <titlefield>Name</titlefield>
            <linkfield></linkfield>
            <fields all="false">
                <field name="Name"/>
            </fields>
        </layer>
        </layers>
    <zoomscale>5000</zoomscale>
    <info>widgets/InfoTemplates/InfoPopupWidget.swf</info>
</configuration>
Tags (2)
0 Kudos
6 Replies
MehulChoksey
Esri Contributor
Try all caps for NAME instead of "Name" The field names are case sensitive.


<?xml version="1.0" ?>
<configuration>
<layers>
<layer>
<name>SLCo Trails</name>
<url>http://gis.slco.org/wwwrest/services/Utah_Trails/Polygons2/MapServer/3></url>
<expression>NAME LIKE'%[value]%'</expression>
<textsearchlabel>Search by Name:</textsearchlabel>
<graphicalsearchlabel>Use one of the graphical search tools to select</graphicalsearchlabel>
<titlefield>NAME</titlefield>
<linkfield></linkfield>
<fields all="false">
<field name="NAME"/>
</fields>
</layer>
</layers>
<zoomscale>5000</zoomscale>
<info>widgets/InfoTemplates/InfoPopupWidget.swf</info>
</configuration>
0 Kudos
EmilyLaMunyon
Deactivated User
Thanks Mehul,

I just tried that and it is still not woring. Do you think it has something to do with my layers?
0 Kudos
DasaPaddock
Esri Regular Contributor
Are you using Viewer version 2.0 beta or 2.1?
0 Kudos
EmilyLaMunyon
Deactivated User
I am using 2.1.
0 Kudos
MehulChoksey
Esri Contributor
Removing extra > after /3 in the url below worked for me:
<url>http://gis.slco.org/wwwrest/services/Utah_Trails/Polygons2/MapServer/3></url>

Tried searching for HOGLE ZOO and it returned result.
0 Kudos
EmilyLaMunyon
Deactivated User
That was it! I cannot believe I missed that, I will look more closely at my code from now on. Thanks for your time:D
0 Kudos