Enhanced Search Widget for FlexViewer 2.1

92903
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
Nadeem,

   I think you are missing an obvious limit of the rest map service that you are querying. You are seeing the 500 feature limit and those parcel just happen to be the first 500 to be returned. I will add you enhancement request to the list.
0 Kudos
DustinKosmach1
New Contributor II
Awesome widget, I finally got it working.  I have one questions.  Is it possible to modify it to do a like instead of equal search? I would like to be able to enter a partial address and have it find any matches.  An example would be I put in 123 Main and the results would show 123 Main St N and 123 Main St S or enter Main st and it would return all address on Main St.

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
dkosmach,

   Sure just look in the SearchWidget.xml file at the expression for the traffic cameras, it has a example of that.
0 Kudos
DustinKosmach1
New Contributor II
OMG, awesome, I got it working
0 Kudos
DustinKosmach1
New Contributor II
I have another question.  I am trying to use the hyperlink field and its sorta working.  I get an arrow in the search box and the link shows up in the popup, but when I click on either the arrow or the link, the new window pops up and combines the address of my app as well as the hyperlink.  This is what i get

http://server/appfolder/www.mcdonalds.com.  How do I fix this?

  <layer>
   <name>Local Businesses</name>
   <url>http://server/ArcGis/rest/services/GIS/Community/MapServer/0</url>
   <expression useforspatial="true">upper(business_name) LIKE upper('%[value]%')</expression>
   <textsearchlabel>Search by Address  [ Example: Buger King]:</textsearchlabel>
   <graphicalsearchlabel>Use one of the graphical search tools to select incidents</graphicalsearchlabel>
   <spatialsearchlabel>Select the two layers for spatial query</spatialsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <spatialrelationlayer>true</spatialrelationlayer>
   <titlefield>Address</titlefield>
   <fields all="false">                
                <field name = "Business_Name" alias="Business Name" />
                <field name = "Business_Type" alias="Type" />
                <field name = "Website_Email" alias="Website" />
            </fields>
   <linkfield linkfieldprefix = "">Website_Email</linkfield>
   <icon isfield="true"></icon>
   <zoomscale>1000</zoomscale>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dustin,

   Can you show me an example of EXACTLY what is in one of those records for the Website_Email field?
0 Kudos
DustinKosmach1
New Contributor II
Heres is the layer, Im not sure what else you might need.
0 Kudos
JasonNielsen
Occasional Contributor
Having some trouble with the Enhanced Search Widget 2.1.7.

I was using the old 2.1.6 and when i upgraded to the 2.1.7 i deleted the Esearch folder under widgets. I then cleaned my project and then copied over the new Esearch widget and followed all of the rest of the instructions.

My problem is the hyperlink works in the grid for a few times, and then suddenly it stops working because the LINKPREFIX gets put in front of the url I have already built by the LINKPREFIX. Example of what it is doing.
http://server/t-assessor.asp?pid=http://server/t-assessor.asp?pid=352585475474  


I see in the documentation that the  "linkprefix in datagrid not getting cleared when new search results are issued" was fixed in 2.1.7. I've cleaned my project, REST services and even tried to build the project and run it on another server, but I still get this problem.

In attempt to try to fix this i have redownloaded the 2.1.7 widget and copied over all of the files in the Esearch widget and slowly edited the xml to fit my data but it eventually appears again.

here is a sample of the SearchWidget.xml
<layer>
   <name>Parcel ID</name>
   <url>http://server/ArcGIS/rest/services/Parcels/MapServer/2</url>
   <expression useforspatial="true">PARCELID like '%[value]%'</expression>
   <textsearchlabel>Search by Parcel ID  [ Example: 350736600508 ]:</textsearchlabel>
   <graphicalsearchlabel>Use one of the graphical search tools to select a Parcel</graphicalsearchlabel>
   <spatialsearchlabel>Select the two layers for spatial query</spatialsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <spatialrelationlayer>true</spatialrelationlayer>
   <titlefield></titlefield>
   <fields all="false">
                <field name="PARCELID" alias="PARCEL ID" gridfield="true" gridfieldonly="true"/>
                <field name="PHOTOS" alias="PARCEL INFORMATION" gridfield="false" gridfieldonly="false" hyperlinkgridfield="true" hyperlinkaliastext="Assessor Information" linkprefix="http://server/t-assessor.asp?pid=" linksuffix=""/>
                <field name="SITUS" alias="SITUS" gridfield="true" gridfieldonly="true"/>
                <field name="DEEDED_ACR" alias="DEEDED ACRES" gridfield="true" gridfieldonly="true"/>
                <field name="TAXPAYER_N" alias="TAXPAYER NAME" gridfield="true"/>
                <field name="MAIL_ADD_1" alias="C/O" gridfield="true" gridfieldonly="true"/>
                <field name="MAIL_ADD_2" alias="MAILING ADDRESS" gridfield="true" gridfieldonly="true"/>
                <field name="MAIL_ADD_3" alias="CITY/STATE" gridfield="true" gridfieldonly="true"/>
                <field name="ZIP_CODE" alias="ZIPCODE" gridfield="true" gridfieldonly="true"/>
                <field name="LINK_JPG" alias="PHOTO OF PROPERTY" gridfield="false"/>    
            </fields>
   <linkfield>LINK_JPG</linkfield>
   <icon isfield="true"></icon>
   <zoomscale>10000</zoomscale>
  </layer>


Does anybody have any ideas?

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jason,

   Thanks for letting me know about this I was able to reproduce your error. I neglected to test by opening and close the datagrid multiple times with the same search results.

    Because my code is in flux right now due to working on the next release version 2.2 I can not put out the code with the fix for this right now but I can show you where to put it in the source code.

In the SearchWidgetFloatDG.mxml find the set dProvider function and replace it's first line with this:
_data = ObjectUtil.copy(value);


   The more I add to or enhance this widget the tougher it gets to manage.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Dustin,

   I am still struggling to reproduce your issue with the viewers url getting added to you link. Unless I can reproduce it, it will be hard for me to diagnose and resolve...
0 Kudos