Select to view content in your preferred language

Problem with Search Widget in 2.5

1834
13
12-08-2011 12:36 PM
by Anonymous User
Not applicable
Original User: ksjosh82

I created a web app using the new application builder and I kept getting the error in the actual webmap in the browser (Firefox 8.0).  I attached the error I keep getting (Capture 2).  I later just tried to copy the Louisville search with my own information and while the widget comes up, as soon as I attempt to perform a search I get an error as well (Capture), I left the Louisville in it just to check it and things work fine.  I'm sure as usual that I have a typo somewhere but finding it is not easy. 

Here is the widget xml file after I modified it that results in the second error message (Capture):
<?xml version="1.0" ?>
<configuration label="Riverview Cemetery">
    <layers>
        <layer>
            <name>Spaces</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/6</url>
            <expression>SpaceID like '[value]'</expression>
            <textsearchlabel>Search by Space ID  [ Example: WEST.10.1.3]</textsearchlabel>
            <titlefield>SpaceID</titlefield>
            <linkfield></linkfield>
            <fields all="false">
                <field name="SpaceID"/>
    <field name="Space"/>
    <field name="Lot"/>
    <field name="Block"/>
    <field name="Addition"/>
            </fields>
        </layer>
        <layer>
            <name>Louisville Police Facilities</name>
            <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/3</url>
            <expression>PD_NAME like '[value]'</expression>
            <textsearchlabel>Search Police Stations by name... [ Example: 2ND DIVISION or 2%]</textsearchlabel>
            <titlefield>PD_NAME</titlefield>
            <linkfield></linkfield>
            <fields all="false">
                <field name="PD_NAME"/>
                <field name="ADDRESS" alias="Address"/>
            </fields>
        </layer>
    </layers>
    <zoomscale>10000</zoomscale>
</configuration>
0 Kudos
13 Replies
by Anonymous User
Not applicable
Original User: ksjosh82

Well, it had been working and now after a return to the Application Builder it reset something and now it refuses to work.  I copied it exactly and still get the faultCode="400" faultDetail="Unable to complete Query operation."  I'll post my config file as well.  Maybe the Application Builder caused an error, its a bummer because the Builder helps simplify the initial process but you don't want to manually modify the xml and then run the Builder again clearly.  Problem is, I can't find the error.

<?xml version="1.0" ?>
<configuration>
    <title>Riverview Cemetery</title>
    <subtitle>Cemetery Records Search Application</subtitle>
    <logo>assets/images/ArkCitylogosmall.png</logo>
    <style>
        <colors>0xffffff,0x333333,0x101010,0x0,0xffd700</colors>
        <alpha>0.8</alpha>
        <font name="Arial"/>
        <titlefont name="Arial"/>
        <subtitlefont name="Verdana"/>
    </style>
    <!-- replace the following url with your own geometryservice -->
    <geometryservice url="http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer" useproxy="false"/>
    <!-- UI elements -->
    <!-- widgets organized into widget containers that manage close/open etc -->
    <!-- supported layout property options: horizontal(default)|float|vertical|fix-->
    <widgetcontainer layout="float">
        <widget left="430" top="90" icon="assets/images/i_bookmark.png" label="Bookmarks" config="widgets/Bookmark/BookmarkWidget.xml" url="widgets/Bookmark/BookmarkWidget.swf"/>
        <widget left="60" top="400" icon="assets/images/i_draw2.png" label="Draw and Measure" config="widgets/Draw/DrawWidget.xml" url="widgets/Draw/DrawWidget.swf"/>
        <widget left="390" top="400" icon="assets/images/i_print.png" label="Print" config="widgets/Print/PrintWidget.xml" url="widgets/Print/PrintWidget.swf"/>
        <widget url="widgets/Search/SearchWidget.swf" config="widgets/Search/SearchWidget_Cemetery.xml" label="Search Cemetery" icon="assets/images/i_search.png"/>
    </widgetcontainer>
    <widget url="widgets/Navigation/NavigationWidget.swf" config="widgets/Navigation/NavigationWidget.xml" left="10" top="50"/>
    <widget url="widgets/OverviewMap/OverviewMapWidget.swf" config="widgets/OverviewMap/OverviewMapWidget.xml" right="-2" bottom="-2"/>
    <widget url="widgets/MapSwitcher/MapSwitcherWidget.swf" config="widgets/MapSwitcher/MapSwitcherWidget.xml" right="20" top="55"/>
    <widget url="widgets/HeaderController/HeaderControllerWidget.swf" config="widgets/HeaderController/HeaderControllerWidget.xml" left="0" top="0"/>
    <map esrilogovisible="true" openhandcursorvisible="true" scalebarvisible="true" zoomslidervisible="false" wraparound180="true" initialextent="1732524.440732611 1465513.1262627246 1732798.3990659334 1465675.738002885" top="40">
        <basemaps>
            <layer type="dynamic" label="CemeteryBaseMap" url="http://gis-server/ArcGIS/rest/services/CemeteryBaseMap/MapServer" visible="true"/>
        </basemaps>
        <operationallayers>
            <layer type="dynamic" label="Cemetery" url="http://gis-server/ArcGIS/rest/services/Cemetery/MapServer" visible="true"/>
        </operationallayers>
    </map>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

can you post the SearchWidget_Cemetery.xml for me to look at?
0 Kudos
by Anonymous User
Not applicable
Original User: ksjosh82

I got that figured out, I deleted my post, but you must have read it first.  Turns out I removed a feature from the map service and so that changed the ID number, which makes sense, and I will have to remember to always check that sort of thing.  Still can't figure out why the fields all tag isn't working, still get the error everytime, and when I change it back to true, I have no issues and the visible tag doesn't work. I guess I'll go ahead and add the SearchWidget_Cemetery anyways as it is altered very slightly from the above posted one.  In this condition, the Search works but will ALL fields.
<?xml version="1.0" ?>
<configuration label="Riverview Cemetery">
    <initialview>text</initialview>
    <layers>
        <layer>
            <name>Search by Last Name</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/5</url>
            <expression>CemeteryRecords.LASTNAME like '[value]'</expression>
            <textsearchlabel>Search by Last Name [ Example: WHITE or WHI%]</textsearchlabel>
            <titlefield>CemeteryRecords.LASTNAME</titlefield>
            <linkfield></linkfield>
            <fields all="true">
                <field name="Spaces.SpaceID" alias="Space ID"/>
                <field name="Spaces.Space" alias="Space"/>
                <field name="Spaces.Lot" alias="Lot"/>
                <field name="Spaces.Block" alias="Block"/>
                <field name="Spaces.Addition" alias="Addition"/>
                <field name="CemeteryRecords.LASTNAME" alias="Last Name"/>
                <field name="CemeteryRecords.FIRSTNAME" alias="First Name"/>
                <field name="CemeteryRecords.M" alias="Middle Initial"/>
                <field name="CemeteryRecords.BIRTHDATE" alias="Birth Date" dateformat="MM/DD/YYYY"/>
                <field name="CemeteryRecords.DEATHDATE" alias="Death Date" dateformat="MM/DD/YYYY"/>
                <field name="CemeteryRecords.Notes" alias="Notes"/>    
            </fields>
        </layer>
        <layer>
            <name>Search by Space ID</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/5</url>
            <expression>Spaces.SpaceID like '[value]'</expression>
            <textsearchlabel>Search by Space ID  [ Example: WEST.10.1.3 (all CAPS)]</textsearchlabel>
            <titlefield>Spaces.SpaceID</titlefield>
            <linkfield></linkfield>
            <fields all="true">
                <field name="Spaces.SpaceID" alias="Space ID"/>
                <field name="Spaces.Space" alias="Space"/>
                <field name="Spaces.Lot" alias="Lot"/>
                <field name="Spaces.Block" alias="Block"/>
                <field name="Spaces.Addition" alias="Addition"/>
                <field name="CemeteryRecords.LASTNAME" alias="Last Name"/>
                <field name="CemeteryRecords.FIRSTNAME" alias="First Name"/>
                <field name="CemeteryRecords.M" alias="Middle Initial"/>
                <field name="CemeteryRecords.BIRTHDATE" alias="Birth Date"/>
                <field name="CemeteryRecords.DEATHDATE" alias="Death Date"/>
                <field name="CemeteryRecords.Notes" alias="Notes"/>
            </fields>
        </layer>
        
    </layers>
</configuration>
0 Kudos
JoshWhite
Honored Contributor
I still haven't figured out the problem with the fields all tag.  The only way the search functions is if I have true which looks terrible with OBJECTID as the first entry.  The visible tag doesn't have any effect as in the popups.  I did notice something that was new though.  I created a new search that doesn't have a joined table  and used <fields all="false"> and it worked.  The difference was that there is not joined table.  I do notice though that the 4th field I typed in does not appear in the search results or the popup that results from clicking on a result.  There is something odd going on here, either a bug or a very hard to locate typo in my config file. 
<?xml version="1.0" ?>
<configuration label="Riverview Cemetery">
    <initialview>text</initialview>
    <layers>
        <layer>
            <name>Search by Last Name</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/9</url>
            <expression>CemeteryRecords.LASTNAME like '[value]'</expression>
            <textsearchlabel>Search by Last Name [ Example: WHITE or WHI%]</textsearchlabel>
            <titlefield>CemeteryRecords.LASTNAME</titlefield>
            <linkfield></linkfield>
            <fields all="true">
                <field name="Spaces.SpaceID" alias="Space ID"/>
                <field name="Spaces.Space" alias="Space"/>
                <field name="Spaces.Lot" alias="Lot"/>
                <field name="Spaces.Block" alias="Block"/>
                <field name="Spaces.Addition" alias="Addition"/>
                <field name="CemeteryRecords.LASTNAME" alias="Last Name"/>
                <field name="CemeteryRecords.FIRSTNAME" alias="First Name"/>
                <field name="CemeteryRecords.M" alias="Middle Initial"/>
                <field name="CemeteryRecords.BIRTHDATE" alias="Birth Date" dateformat="MM/DD/YYYY"/>
                <field name="CemeteryRecords.DEATHDATE" alias="Death Date" dateformat="MM/DD/YYYY"/>
                <field name="CemeteryRecords.Notes" alias="Notes"/>    
            </fields>
        </layer>
        <layer>
            <name>Search by Space ID</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/9</url>
            <expression>Spaces.SpaceID like '[value]'</expression>
            <textsearchlabel>Search by Space ID  [ Example: WEST.10.1.3 (all CAPS)]</textsearchlabel>
            <titlefield>Spaces.SpaceID</titlefield>
            <linkfield></linkfield>
            <fields all="true">
                <field name="Spaces.SpaceID" alias="Space ID"/>
                <field name="Spaces.Space" alias="Space"/>
                <field name="Spaces.Lot" alias="Lot"/>
                <field name="Spaces.Block" alias="Block"/>
                <field name="Spaces.Addition" alias="Addition"/>
                <field name="CemeteryRecords.LASTNAME" alias="Last Name"/>
                <field name="CemeteryRecords.FIRSTNAME" alias="First Name"/>
                <field name="CemeteryRecords.M" alias="Middle Initial"/>
                <field name="CemeteryRecords.BIRTHDATE" alias="Birth Date"/>
                <field name="CemeteryRecords.DEATHDATE" alias="Death Date"/>
                <field name="CemeteryRecords.Notes" alias="Notes"/>
            </fields>
        </layer>
      <layer>
            <name>Search by Lot ID</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/10</url>
            <expression>LotID like '[value]'</expression>
            <textsearchlabel>Search by Lot ID  [ Example: WEST.10.1 (all CAPS)]</textsearchlabel>
            <titlefield>LotID</titlefield>
            <linkfield></linkfield>
            <fields all="false">
                <field name="LOT" alias="LOT"/>
                <field name="BLOCK" alias="BLOCK"/>
                <field name="ADDITION" alias="ADDITION"/>
                <field name="LotID" alias="Lot ID"/>
                
            </fields>
        </layer>
        
    </layers>
</configuration>
Josh White, AICP
Principal Planner

City of Arkansas City
0 Kudos