Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

158471
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
RobertScheitlin__GISP
MVP Emeritus
Eric,

   Have you tried just typing your url: http://arcgis-srv1.village.gurnee.il.us/ArcGIS/rest/services/Subdivisions/MapServer/1 in the address bar of a browser and clicking the query link and adding
SUB_NAME LIKE '%Southridge%'

to the where box and * in the outfields to see if it works in the REST services directory?
0 Kudos
EricVenden
Frequent Contributor
Robert,
Thanks for the suggestion - this works fine..the query returns results.  The grid view in the flex app does show the proper results, it's just the "initial" window that only displays the Error message.
Eric
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   OK, you are the only one reporting having an issue like this so I need you so continue to help me diagnose this issue as it must be specific to your data or configuration some how. Do the same thing that I asked you to do last time but instead out putting * for the outfields this time specify the fields
SUB_NAME,SUB_PHASE,SUB_UNIT,DOC_NUM,PLAT_PDF,OBJECTID
0 Kudos
EricVenden
Frequent Contributor
Robert,
If I enter:       like '%southridge%'
The query will not run (I get an "Unable to perform query" message). 

If I enter:        southridge
I get all records LIKE southridge and the proper return fields (specifying * or certain fields).

If I enter:       %southridge%
I get "No Results Found"

I'm familiar with sql, but not quite sure how select statements are parsed in REST services.
Additionally, how is the query field determined?  Does it use the first text field for a feature class?
See attached
Thanks Robert
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

    Try adding:
SUB_NAME LIKE '%Southridge'
in the Where box not the top box that you are questioning about. The field that you are asking about is determined by the display field in ArcMap for that particular layer. So in ArcMap if you go to the layer properties and then display tab you will see (in v10) Display Expression then field. What this means is a published map service is that field is used as
Shorthand for a literal search text on the display field, equivalent to: where YourDisplayField like '%SearchText%'.
The search expression of '%something%' means that you are expecting any number of character in front of and after the something string. So if your SUB_NAME field has the exact value of "Southridge" than there is no need for the like and wildcards.
0 Kudos
EricVenden
Frequent Contributor
Robert,
The results are returned properly by entering a valid where clause and using the * or specifying the fields to be returned.

Eric
0 Kudos
EricVenden
Frequent Contributor
Robert,
Not sure if this is helpful, but if I enter a value that I know will not return results, the widget returns "Features Selected: 0"...

Eric
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   I got to say I am stumped then. I can not duplicate the error so it is hard to say what is going wrong. Last chance effort... Can you do the query again on the REST services directory page using the where box and specifying the fields and change the format at the bottom of the page to JSON then when you get the results highlight them and copy and paste them into a text file and attach that text file to a post for me to review?
0 Kudos
EricVenden
Frequent Contributor
Robert,
There are numerous null values in the data  (in the SUB_NAME field)....let me edit these values and see if this does the trick.  Is this a possibility?

Thanks
Eric
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   That shouldn't be an issue but give it a try.
0 Kudos