Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

140434
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
ErwanCaradec
Emerging Contributor
Hello Nadeem,
has Robert merged my code for the spatial search to his enhanced search, the two original part of the widget dont use the same source for the spatial reference. The spatial search use the map spatial reference instead of the wkid set in the SearchWidget.xml. I'll report this problem to Robert, he will decide wich is the best solution.

Erwan.
0 Kudos
NadeemShaukat
Deactivated User
Hello Nadeem,
has Robert merged my code for the spatial search to his enhanced search, the two original part of the widget dont use the same source for the spatial reference. The spatial search use the map spatial reference instead of the wkid set in the SearchWidget.xml. I'll report this problem to Robert, he will decide wich is the best solution.

Erwan.


Erwan,

Thanks for the clarification. I would like to request Robert too to find the best solution, but I will prefer the solution of using wkid in the SearchWidget.xml.

nshaukat
0 Kudos
EricVenden
Frequent Contributor
Robert,

We are using v 2.1.5 of your search widget.  We have 1 search configured that works properly.  The results listing shows the "TITLEFIELD" and 1 other field that we have aliased.  We are having problems getting the results listing to work for 3 other searches.  These 3 other searches use a layer that contains a join.  The search works in that it finds the proper results, but the results grid is empty. (see attached image)  Do we have to include the fully-qualified name for the TITLEFIELD? Any assistance would be appreciated.
Thanks
Eric Venden
Village of Gurnee
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

    I don't work with joins all that often but as far as I remember yes you need the fully qualified field name in the xml configuration.
0 Kudos
NadeemShaukat
Deactivated User
Robert,

I would like to bring your attention to a minor glitch in the eSearch widget. Please refer to the attached graphic. When the widget is launched first time by clicking on the widget button, the Graphical Search is selected by default. But the window shows components from Text Search.

I do not where in the mxml to fix this issue.

nshaukat
0 Kudos
BarbaraPatterson
Emerging Contributor
Hi Robert - I am trying to modify your widget slightly by passing in the url as a variable from another widget I've created. The reason I'm doing this is that the user will only ever be able to view one layer (out of more than 100). I don't want them to have to scroll through a long list and I also don't want to have to list all of the layers in the xml file. Since all the layers have similar fields, it should work to make the url a variable and specify the remainder of the parameters in the searchwidget.xml file. To do this, I've tried to create a global variable class which looks like this:

package com.esri.viewer.utils
{
 public class GlobalVarContainer
 {
  public static var vars:Object = {};
  public static var searchurl:String = "" ;
 }
}


Then in my widget
import com.esri.viewer.utils.GlobalVarContainer;


//and within my function that specifies which map service and layer to display I try to pass the url //to the global variable searchurl

for each  (var item : LayerInfo in alllayers)
       
    {
     var lyrname:String = item.name;
     if (lyrname == qryname)
     {
      var lyrnum:String = item.id.toString();
      var urlstr:String = lyr.url + "/" + lyrnum;
      GlobalVarContainer.searchurl = urlstr;
      visibleLayers.addItem(item.id); // add id
     }

Then in SearchWidget.mxml
import com.esri.viewer.utils.GlobalVarContainer;

//and within private function init():void

for (var i:Number = 0; i < lyrList.length(); i++)
     {
      //var lyrURL:String = lyrList.url;
      var lyrURL:String = GlobalVarContainer.searchurl;


When I debug, I get the error in my widget "No such variable: GlobalVarContainer"

Any suggestions? I've read that trying to create global variables is frowned upon but I'm not sure how else to approach it.

Any help would be greatly appreciated!!

Thanks!
Barb Patterson
0 Kudos
KyleOberg
Occasional Contributor
Is this the tool I'm looking for if I'd like to select a parcel, enter a buffer distance and return a list of intersecting parcels that can be used to generate mailing labels? I couldn't get this to happen in the application provided. If not, is this functionality available in an existing template application?
0 Kudos
ErwanCaradec
Emerging Contributor
Kyle,
i think you could do it with this tool, the spatial search can intersect a layer with itself.

A example with Louisville parcels :
You can specify a parcel number in the where zone of visible entities to buffer (with a correct xml configuration of course), the buffer size, it returns all parcels intersected with the buffer.
You can then export the results in a csv file.

Parcels Layer configuration for this example :
  <layer>
   <name>Parcels</name>
   <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/0</url>
   <expression useforspatial="true">PARCELID like '%[value]%'</expression>
   <textsearchlabel>Search by Parcel ID  [ Example: 181001490000 ]:</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>PARCELID</titlefield>
   <fields all="false">
                <field name="PARCELID" alias="Parcel Id" gridfield="true"/>
            </fields>
   <linkfield></linkfield>
   <icon isfield="true"></icon>
   <zoomscale>40000</zoomscale>
  </layer>


Erwan
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

     A new version (2.1.6) is available that addresses most issues or enhancements requested.
0 Kudos
NadeemShaukat
Deactivated User
All,

     A new version (2.1.6) is available that addresses most issues or enhancements requested.


Robert,

You are great.

I have downloaded/implemented the uncompiled version 2.1.6 and found out that all issues about your enhanced widget that surfaced recently are fixed.

Cheers!

nshaukat
0 Kudos