Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

158552
767
10-25-2010 02:13 PM
RobertScheitlin__GISP
MVP Emeritus
All Here is my next widget in the FlexViewer 2.1 series

Special thanks to Erwan Caradec for contributing to this code.

The Enhanced Search Widget extends the standard search widget with a floating data grid and a new spatial query w/buffering.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e
Tags (2)
0 Kudos
767 Replies
NestorNavarro
Emerging Contributor
Thanks Robert !!

It is a great widget and the resizing is a nice touch.
Only thing I need is for the API to handle one to many relationships and everyone would be happy.

Nestor.
0 Kudos
CynthiaMatney
Emerging Contributor
I have the newest Enhanced Serach Widget downloaded 2.2.7f - One of my layers I want to be able to search is my zoning layer.  It works fine until I try to use the domain "usedomain="true'...  I run my viewer and when I open the search window it shows up as it should - shows my domain values of my zoning layer in a dropdown box.  However, when I click on one to search (ie: "R-1A") - it returns no values.  If I take out the line "usedomain" then type in "R-1A" myself - then values are returned.  Any ideas?
Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cynthia,

    Can you go to your REST Service Directory and copy some of the lines like this and paste them for me to review:

Fields:

    * OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
    * Local_ID (Type: esriFieldTypeString, Alias: Local ID, Length: 10 )
    * Bin (Type: esriFieldTypeInteger, Alias: Bin)
    * Length_ (Type: esriFieldTypeDouble, Alias: Length)
    * B_Road_W (Type: esriFieldTypeDouble, Alias: Bridge Roadway Width (Curb to Curb))
    * Deck_W (Type: esriFieldTypeDouble, Alias: Deck Width (Out to Out))
    * Approach_R_W (Type: esriFieldTypeDouble, Alias: Approach Roadway Width)
    * Span_Num (Type: esriFieldTypeSmallInteger, Alias: Number of Spans)
    * M_Span_L (Type: esriFieldTypeDouble, Alias: Max Span Length)
    * Deck_Cond_C (Type: esriFieldTypeString, Alias: Deck Condition Code, Length: 5, Domain: Coded Values: , [9: 9 - Superior to present desirable criteria], [8: 8 - Equal to present desirable criteria], ...8 more... )


I am interested in seeing the fields that have domains.
0 Kudos
CynthiaMatney
Emerging Contributor
Fields:
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
ZONECLASS (Type: esriFieldTypeString, Alias: Zoning Classification, Length: 10, Domain: Coded   Values: [Agriculture District: A], [Suburban Residential District: R-1A], [Low-Density Single-Family Residential District: R-1B], ...29 more... )
ZONEDESC (Type: esriFieldTypeString, Alias: Zoning Description, Length: 100, Domain: Coded Values: , [R-1A: Surburban Residential District], [R-1B: Low-Density Single-Family Residential District], .....
ACRES (Type: esriFieldTypeDouble, Alias: ACRES)
SHAPE (Type: esriFieldTypeGeometry, Alias: SHAPE)
URL (Type: esriFieldTypeString, Alias: URL, Length: 200 )
ZONE_OFF (Type: esriFieldTypeString, Alias: Official Zoning, Length: 20 )
SHAPE.area (Type: esriFieldTypeDouble, Alias: SHAPE.area)
SHAPE.len (Type: esriFieldTypeDouble, Alias: SHAPE.len)
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cynthia,

   Now can I see your SearchWidget.xml
0 Kudos
CynthiaMatney
Emerging Contributor
This is the only part I have changed on the xml.

<layer>
<enableexport>true</enableexport>
            <name>Zoning</name>
            <url>http://maps/ArcGIS/rest/services/Layers/Zoning/MapServer/0</url>
            <expressions>
             <expression alias="Zoning Code"
              textsearchlabel="Search Zoning Code [ Example: R-1A ]:"
              field="ZONECLASS" usedomain="true">upper(ZONECLASS) = upper('[value]')</expression>
             <expression alias="Zoning Name"
              textsearchlabel="Search Zoning Name [ Example: SUBURBAN RESIDENTIAL DISTRICT ]:"
              field="ZONEDESC" usedomain="true">upper(ZONEDESC) = upper('[value]')</expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>ZONECLASS</titlefield>
            <linkfield linkprefix="" linksuffix="">URL</linkfield>
   <icon isfield="true" iconprefix="" iconsuffix=""></icon>
            <fields all="false">
                <field name="ZONECLASS" alias="Zoning Code"/>
                <field name="ZONEDESC" alias="Zoning Name"/>
                <field name="ACRES" alias="Acres"/>
                <field name="URL" alias="URL"/>
            </fields>
        </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cynthia,

   Hmm... I was actually refering to the one that you are attempting to use the domain for. I need to see how you are setting that expression up.
0 Kudos
CynthiaMatney
Emerging Contributor
Cynthia,

   Hmm... I was actually refering to the one that you are attempting to use the domain for. I need to see how you are setting that expression up.


Sorry - I changed it above.
0 Kudos
philippschnetzer
Frequent Contributor
Is it possible to query on two fields from the same layer in one expression?  I have obviously had no luck in my attempts...

I am trying to get something like this:

PID LIKE '[value]%' AND AAN LIKE '[value]%'</expression>    


to work...currently they are working as separate search expressions (PID LIKE '[value]%') and (AAN LIKE '[value]%').

Is this even possible with the eSearch Widget?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
philipp,

   It is (sort of)... You can have any valid SQL expression run by this widget if you set the expression to:

<expression alias="Advanced Query" 
textsearchlabel="Enter any Valid SQL Expression"
field="" usedomain="false">[value]</expression>


This will force the user to be responsible for typing a valid SQL expression in the input text box.

This is the only way you can do it, as this widget does not and probably never will support multiple fields and values (that what the Query Builder widget is for).
0 Kudos