Select to view content in your preferred language

Search Widget error

702
3
Jump to solution
06-25-2014 11:13 PM
TimHayes
Frequent Contributor
I would like this widget to look like what I have attached. But, I keep getting an error when I give it a test drive in the viewer.


I have modified the code for the Search Widget (Flex Viewer 3.6) to look like this:

<?xml version="1.0" ?>
<configuration label="Find Meter by SBWR ID">
    <layers>
        <layer>
            <name>Meters</name>
            <url>http://mygisserver:6080/arcgis/rest/services/sSBWRMeters/MapServer/0</url>
            <expression>SBWR_ID = '[value]'</expression>
            <textsearchlabel>Search by SBWR ID  [ Example: SJW-025-0433]</textsearchlabel>
            <titlefield>SBWR ID</titlefield>
            <linkfield></linkfield>
            <fields all="false">
                <field name="SBWR_ID"/>
            </fields>
        </layer>
    </layers>
    <zoomscale>1000</zoomscale>
</configuration>

<!--
    See Search widget tag reference at
    http://links.esri.com/searchwidget
-->
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Tim and Anthony,

   Based on the provided image it does not look like Tim has the search widget tag in the main config.xml pointing to the correct XML file (the one that he has in the post).

Tim are you sure you have the search widget in the main config.xml pointing to your modified searchwidget.xml?

View solution in original post

0 Kudos
3 Replies
AnthonyGiles
Honored Contributor
Tim,

What error are you getting? I cannot see anything obviously wrong in your config.  Just a check you do have your objectid and shape fields turned on for your layer in the service.

Also if you want a wildcard search your expression needs to use the like statement:

<expression>SBWR_ID LIKE '%[value]%'</expression>

Regards

Anthony
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Tim and Anthony,

   Based on the provided image it does not look like Tim has the search widget tag in the main config.xml pointing to the correct XML file (the one that he has in the post).

Tim are you sure you have the search widget in the main config.xml pointing to your modified searchwidget.xml?
0 Kudos
TimHayes
Frequent Contributor
Robert was correct. I overlooked the fact that the search widget location in my config.xml file was pointing the ESRI url, not to the location in my flexviewer folder. That's what happens when I write xml for 8hrs straight no break. I am learning.

The widget works now.
0 Kudos