Select to view content in your preferred language

Problem with Search Widget in 2.5

1828
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: rscheitlin

Josh,

   In the MXD do you have the shape and/or objectid field hidden for the spaces layer? If so that is an issue.
0 Kudos
JoshWhite
Honored Contributor
Nope, I'm afraid they are not hidden.
Josh White, AICP
Principal Planner

City of Arkansas City
0 Kudos
by Anonymous User
Not applicable
Original User: rscheitlin

Josh,

   What is the field type of the SpaceID?
0 Kudos
JoshWhite
Honored Contributor
The field type is String.
Josh White, AICP
Principal Planner

City of Arkansas City
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   What is the search value you are entering and can you successfully perform a query on that layer in the REST service directory?
0 Kudos
by Anonymous User
Not applicable
Original User: ksjosh82

Robert,
Thanks for your help.  I discovered the problem and I appreciate your willingness to help.  A REST cache cleaning helped me realize my error.  The table in the mxd is joined to another table so I need the featurename.fieldname instead of just fieldname.  In other words, it was attempting to locate fields that didn't exist.  I knew it had to be a goofy typo.  On another note, while I have you, is there a way to force the widget to come up with the entry view rather than the geometry search?  The geometry search is okay to have but I think my users would prefer to enter.   I am using the compiled version and don't have FlexBuilder (or whatever its called) so I cannot edit the backend.  Perhaps one of your widgets would actually be better for this sort of thing?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Sure just add:

<initialview>text</initialview>
to the SearchWidget_???.xml
0 Kudos
by Anonymous User
Not applicable
Original User: ksjosh82

Two things:
The web app does not honor the <initialview> tag and also I get an error if I use <fields all="false">  which I want to do as OBJECTID and SHAPE_Length mean nothing to a user.  I thought maybe it was similar to the popup bug in 2.4 but I'm unable to produce that error by reducing the number of fields so I don't belive that is the problem.
<?xml version="1.0" ?>
<configuration label="Riverview Cemetery">
    <layers>
        <initialview>text</initialview>
  <layer>
            <name>Search by Last Name</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/6</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/6</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 Space ID2</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/6</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="false">
                <field name="Spaces.SpaceID" alias="Space ID"/>
    <field name="CemeteryRecords.LASTNAME"alias="Last Name"/>
        
    
            </fields>
        </layer>
        
    </layers>
    
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Josh,

   Try this, copy EXACTLY what I have here:

<?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/6</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/6</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 Space ID2</name>
            <url>http://gis-server/ArcGIS/rest/services/Cemetery/MapServer/6</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="false">
                <field name="Spaces.SpaceID" alias="Space ID"/>
                <field name="CemeteryRecords.LASTNAME" alias="Last Name"/>
            </fields>
        </layer>
    </layers>
</configuration>
0 Kudos