Enhanced Search Widget for FlexViewer 2.1

93396
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
Justin,

   That version has been tested with joined data and works just fine (joins from SDE as well). Just to be sure your not confusing a join and a relate are you?
0 Kudos
JustinFultz
New Contributor III
The data is related in the database, but I have also joined the data in the mxd to try to get the extra fields into the datagrid.  I'll keep tinkering and let you know if I find a fix.
0 Kudos
JonFisher
New Contributor III
Make sure you're copying field names exactly as shown in REST. For example, this map: http://maps.tnc.org/coredata has the following xml to support a joined table:

        <layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Conservation Projects</name>
   <url>http://maps.tnc.org/ecadpubprodanon/rest/services/conservation_projects_anon_WM/MapServer/1</url>
  <!-- expression is for the "text search" function; users will enter [value] and you determine how that input is used to return records -->
   <expressions>
    <expression alias="Search by Name" textsearchlabel="Find Conservation Projects by Name:" usedomain="false" field="CP_STEWARD.PROJECTS.PROJECT_NAME">lower(CP_STEWARD.PROJECTS.PROJECT_NAME) LIKE lower('%[value]%')</expression>
    <expression alias="Search by ID" textsearchlabel="Find Conservation Projects by ID:" usedomain="false" field="CP_STEWARD.PROJECTS.PROJECT_ID">CP_STEWARD.Project_Polys.PROJECT_ID=[value]</expression>
   </expressions>
   <graphicalsearchlabel>Find details about conservation projects by clicking on one of the tools below, then clicking on the site you want to find out more about (read the help for details).</graphicalsearchlabel>
   <spatialsearchlayer>false</spatialsearchlayer>
   <titlefield>CP_STEWARD.PROJECTS.PROJECT_NAME</titlefield>
  <!-- Rather than specifying each field, you can simply return all fields by changing "false" to "true" below and deleting or commenting out the field name tags -->
   <fields all="false">
  <!-- The field tag must include the actual field name, but can optionally include "alias" or "dateformat" or "gridfieldonly" or many more. Note that if you don't manually specify an alias the alias from your mxd will be used (or the field name if no alias exists) -->
    <field name="CP_STEWARD.PROJECTS.PROJECT_NAME" gridfield="true"/>
    <field name="CP_STEWARD.PROJECTS.PROJECTORG" gridfield="true"/>
    <field name="CP_STEWARD.PROJECTS.CONTACTORG" gridfield="true"/>
    <field name="CP_STEWARD.PROJECTS.CONPRO_URL" hyperlinkgridfield="true" hyperlinkaliastext="Open ConPro record" alias="ConPro URL"/>
   </fields>
  <!-- If the link has an extension of .jpg, .gif, or .png a preview image will be displayed, otherwise a clickable "i" symbol will show up for the link --> 
   <linkfield>CP_STEWARD.PROJECTS.CONPRO_URL</linkfield>
   <icon isfield="false"></icon>
   <zoomscale usegeometry="true"/>
   <autoopendatagrid>false</autoopendatagrid>
  </layer>
0 Kudos
JustinFultz
New Contributor III
Ok Robert... I'm a little embarrassed to tell you how I fixed this.

I have two very similar services.  One of them included the join and the other didn't.  I managed to change MOST references in the Flex project to the new service with the join.  MOST, meaning all but this search feature class(the only one that really mattered).

Changed the reference to the new service and worked like a charm. 

Sorry for the runaround.

Thanks,

Justin
0 Kudos
JustinFultz
New Contributor III
Robert,

One more issue i've run into. 

After joining the table and displaying the results, the column widths in the data grid are all the same, rather than being determined by the width of the data being displayed as before.  This is causing a lot of blank space and making the user scroll much farther than necessary.

Can you help with this?

Thanks,

Justin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

   It took a bit to figure this one out but the fix is now available in Version 2.4.0.11
0 Kudos
JustinFultz
New Contributor III
Works great! Thanks for the quick fix!
0 Kudos
EmilyLaMunyon
Occasional Contributor
Emily,

   Nope... Not currently but this seems like a good Idea I will add it to the wish list.


Hi Robert,

I noticed you released an update to the esearch widget today and was curious to see if you could look at adding the ability to concatenate fields together in the next release or two?  We are almost ready to go live with our map and having this functionality is one of the last things needed. I don't want to bother you, just curious if you even think this is a possibility.:o

<![CDATA[<a href="http://surveyor.slco.org/gis/map/map_search/mrs_test.cfm?mrspoint={POINT_NAME}&lat={LATITUDE_DD}&long={LONGITUDE_DD}">View Mon. Ref Sheet</a>]]>

Thanks!!!

Emily
0 Kudos
MarkHanway1
New Contributor
Robert,

Thanks for the latest enhanced search widget...this is really great, thank you.   I love the option to limit the layers that can be included in the dropdown for the spatial search. 

I would like to have the same thing happen on the Text Input page.  Is it possible to limit the layers in the drop-down for search layer on the Text Input page?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Emily,

   Maybe soon. It is always a lot more complicated than end users imagine to do enhancements like this.
0 Kudos