Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

137505
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
MarkDumford
Emerging Contributor
Hi Robert,

What is the best way to make the check box for "add search tolerance to point selection"  to be "checked" by default.

The reason I ask is that i cannot get the point selection tool to actually select a point feature unless I check the box first. It seems kind of redudant, unless I am missing something. I have set the toleranceforpointgraphicalselection value to 100. If you set this value, would you not want the user to use this as the default.

Thanks for any assistance or direction that you can provide.

Mark
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Mark,

   Hmm... No I don't believe it's redundant as is has a default value of 3 pixels. So the setting of this value is not used to automatically determine that the tolerance should be used. But adding a new configuration option for this is simple enough so version 2.5.0.2 will have this ability.

Version 2.5.0.2 - 12/5/2011
* Depreciated tolerance. Now just use toleranceforpointgraphicalselection
* Added a tolerancebydefault option to the SearchWidget.xml.
0 Kudos
JeremyCantor
Deactivated User
Robert,

Possible bug.  I'm using v.2.5.0.2.  I have two fields with Coded Value Domains.  When I search and then open the data grid, both those fields show values of [object CodedValue].  See attached image.  However, in the search box, they show up fine.  Any suggestions?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   This is the story of a programmer... Fix one thing break something else and forget to test all the feature that were working...

Version 2.5.0.3 - 12/6/2011
* Fixed Coded domains bug introduced in version 2.5.0.1
* Relates Sum field does not clear when choosing a relate that has no sum field
  specified.
0 Kudos
JeremyCantor
Deactivated User
Robert, thanks so much for the quick turn-around.  Looks good now.
0 Kudos
SimonMorgan
Frequent Contributor
Robert,

I am trying to get the relate feature to work, any ideas why it doesn't:

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>All Minnesota Public Schools</name>
   <url>http://[server]/ArcGIS/rest/services/swan/CRANE_alldata/MapServer/1</url>
   <expressions>
    <expression alias="School Name" textsearchlabel="Search for schools by name">SCHNAME Like '%[value]%'</expression>
    <expression alias="Type of School" textsearchlabel="Search for schools by type" userlist="ELEM,MIDD,HIGH,ALC,SECOND FACILITY COOP,CHARTER,COLLEGE,COOP,CORRECTIONAL,EDUCATION_DISTRICT,DISTRICT-OTHER,INDEPENDENT,INTERMEDIATE DIST,OFFICE,OTHER,SPECIAL">SCH_TYPE1 LIKE '%[value]%'</expression>
    <expression alias="School District Number" textsearchlabel="Search for schools by Schoo District Number">SDNUM = [value]</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select schools</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>SCHNAME</titlefield>
   <linkfield linkprefix="" linksuffix="">WEB_URL</linkfield>
   <icon isfield="false" iconprefix="" iconsuffix=""></icon>
   <fields all="false">
    <field name="SCHNAME" alias="School Name" gridfield="true"/>
    <field name="ORGID_REL" alias="School Unique ID" gridfield="true"/>
    <field name="ADDRESS" alias="Address" gridfield="true" gridfieldonly="true"/>
    <field name="CITY" alias="City" gridfield="true" gridfieldonly="true"/>
    <field name="STATE" alias="State" gridfield="true" gridfieldonly="true"/>
    <field name="ZIP" alias="Zip Code" gridfield="true" gridfieldonly="true"/>
    <field name="SCH_TYPE" alias="School Type" gridfield="true" gridfieldonly="true"/>
    <field name="SCH_TYPE1" alias="School Type 1" gridfield="true" gridfieldonly="true"/>
    <field name="WEB_URL" alias="School Website" hyperlinkgridfield="true" hyperlinkaliastext="Visit School's Website"/>
   </fields>
   <autoopendatagrid>false</autoopendatagrid>
   <relates>
    <relate id="1" label="Resevations">
     <fields all="true" />
    </relate>
   </relates>
  </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

   I used your xml you provided and searched for "Weaver lake Elem" and the reservation for that school came up fine.
0 Kudos
SimonMorgan
Frequent Contributor
Simon,

   I used your xml you provided and searched for "Weaver lake Elem" and the reservation for that school came up fine.


I did several things, including clearing my rest cache, copying the widget you had precompiled (instead on the one I had compiled with my viewer), and made sure all the assets were in place and now it works.

As a side note the images folder in eSearch\uncompiled\eSearch\assets\images has 21 images and the images folder in eSearch\FV2.5compiled\eSearch\assets\images only has 17. Just wanted to let you know.

Thank you for this GREAT widget.

I know the code base is complex for this widget but would you entertain a request to bring attachments to this widget like your infotemplates widget?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Simon,

   Try downloading again. I updated the zip to ensure the correct number of assets in each folder.

I will add attachment support to the wish list, although I am getting concerned that this widget does to much (the main mxml is nearly 4000 lines of code. and has 22 supporting files).
0 Kudos
SimonMorgan
Frequent Contributor
Simon,

   Try downloading again. I updated the zip to ensure the correct number of assets in each folder.

I will add attachment support to the wish list, although I am getting concerned that this widget does to much (the main mxml is nearly 4000 lines of code. and has 22 supporting files).


Thanks for doing that!!

I am having an issue with relates again. The relate button displays but says there are no related records, even for schools where I know there are multile related records.

<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Minnesota School</name>
   <url>http://gis.threeriversparkdistrict.org/ArcGIS/rest/services/swan/CRANE_alldata/MapServer/1</url>
   <expressions>
    <expression alias="School Name" textsearchlabel="Search by school name...">SCHNAME LIKE '%[value]%'</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select schools</graphicalsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <titlefield>SCHNAME</titlefield>
   <fields all="false">
    <field name="SCHNAME" gridfield="true"/>
    <field name="SDNUM" gridfield="true"/>
    <field name="WEB_URL" gridfield="true" hyperlinkgridfield="true"/>
   </fields>
   <linkfield>WEB_URL</linkfield>
   <icon isfield="false"></icon>
   <zoomscale usegeometry="true"/>
   <autoopendatagrid>false</autoopendatagrid>
   <relates>
    <relate id="0" label="Reservations">
     <fields all="true" />
    </relate>
    <relate id="1" label="Enrollment by Gender and Ethnicity">
     <fields all="true" />
    </relate>
    <relate id="2" label="Enrollment by Special Populations">
     <fields all="true" />
    </relate>
   </relates>
  </layer>

Any ideas?
0 Kudos