Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

158359
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
AlexSanders
Frequent Contributor
Thanks for the info, I added the tag to the otb search viewer xml and it is working as well.
0 Kudos
JustinFultz
Regular Contributor
Robert,

I would like to set up a search on a stand alone table and don't know if it is possible through this widget.

I have a point layer and stand alone table in a map service that are related. I can search the point layer and return the related records from the stand alone table, but I would like to search the stand alone table and return related points. When I try to set this up in the eSearch.xml I get no results in my web app when searching the table.

I can successfully query the stand alone table in the ArcGIS Services Directory. Am I doing something wrong, or is this not possible with the current version of the widget?

Thanks for all of your hard work!

Justin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

   Searching Flat (no geometry) tables is not supported in this widget currently.
0 Kudos
JustinFultz
Regular Contributor
Thanks for the quick reply!!!

Any plans to incorperate this into a future release?

So if I convert this table into a point layer and give each record the geometry of the related existing point, could I just turn off symbology in the map document and accomplish the same thing?

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Justin,

   Yes, I will add it to the list of requested enhancements.

So if I convert this table into a point layer and give each record the  geometry of the related existing point, could I just turn off symbology  in the map document and accomplish the same thing?

Sounds like that would work just fine.
0 Kudos
SimonMorgan
Frequent Contributor
Thanks for the quick reply!!!

Any plans to incorperate this into a future release?

So if I convert this table into a point layer and give each record the geometry of the related existing point, could I just turn off symbology in the map document and accomplish the same thing?

Thanks!


I kind of acheieved what you are looking for. I have a point layer of schools and a table only dataset with a list of school reservations. I wanted Robert's tool to return the location of every schoool that had made a reservation. I did it using a little SQL:

<definitionexpression>
    EXISTS (SELECT * FROM central2.GISADMIN.TRPD_Schdgrps_Schools 
    WHERE central2.GISADMIN.MN_Schools_PUBLIC.ORGID_REL = central2.GISADMIN.TRPD_Schdgrps_Schools.School_Code)
   </definitionexpression>
   <enableexport>true</enableexport>
   <name>Minnesota Schools - Users</name>
   <url>http://[server]/ArcGIS/rest/services/swan/CRANE_alldata/MapServer/1</url>
   <expressions>
    <expression alias="All users" 
       textsearchlabel="Search for all non-user schools" 
       userlist="1=1">[value]</expression>
    <expression alias="All users by time period" 
       textsearchlabel="Enter a year (2010) or a time period (2010 Q1)"> 
       EXISTS (SELECT * FROM central2.GISADMIN.TRPD_Schdgrps_Schools 
       WHERE central2.GISADMIN.MN_Schools_PUBLIC.ORGID_REL = central2.GISADMIN.TRPD_Schdgrps_Schools.School_Code 
       AND central2.GISADMIN.TRPD_Schdgrps_Schools.TimePeriod LIKE '%[value]%')</expression>
    <expression alias="Multiple reservations" 
       textsearchlabel="Enter a year (2010) or a time period (2010 Q1)">
       gisadmin.MN_SCHOOLS_PUBLIC.ORGID_REL IN 
       (SELECT tss.School_Code FROM central2.gisadmin.TRPD_SCHDGRPS_SCHOOLS tss 
       WHERE tss.TimePeriod Like '%[value]%' GROUP BY tss.School_Code HAVING COUNT(*) > 1)</expression>
    <expression alias="Single reservation" 
       textsearchlabel="Enter a year (2010) or a time period (2010 Q1)">
       gisadmin.MN_SCHOOLS_PUBLIC.ORGID_REL IN 
       (SELECT tss.School_Code FROM central2.gisadmin.TRPD_SCHDGRPS_SCHOOLS tss 
       WHERE tss.TimePeriod Like '%[value]%' GROUP BY tss.School_Code HAVING COUNT(*) = 1)</expression>
    <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>


You will notice that in the definition query tag, I used the exists command of SQL. ArcGIS automatically starts every query with the select statement, so you essentially can only build a query after "select * from where" and so you do not need to type that as you may already know.

EXISTS (SELECT * FROM central2.GISADMIN.TRPD_Schdgrps_Schools
    WHERE central2.GISADMIN.MN_Schools_PUBLIC.ORGID_REL = central2.GISADMIN.TRPD_Schdgrps_Schools.School_Code)

This query essentially looks at the schools table and only returns schools that have a matching school ID in the reservations table.

Just thought I would share, it may not do exactly what you need, but hopefully it was helpful!

One thign to note, this query may not give an expected result if your table is registered as versioned because it does nto query the  A and D tables.
0 Kudos
HeenaLee
Regular Contributor
Hi Mark,

Did you figure this out yet?
I changed visible="true" to visible="false" in SearchWidget.mxml line 3653. After that, "add search tolerance to point search" was set to "checked" by default.
  <s:Group id="spatialInput"
     width="100%" height="100%"
     visible="false"
     visible.spatialInput="true">
   <s:layout>

Heena
Village of Algonquin, IL

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
SimonMorgan
Frequent Contributor
Robert,

I have a question. I just switched one of my esearch widgets over to the new 2.5.0.7 XML format. This is how I setup the link:

<links>
    <link includeinresults="false" field="WEB_URL" alias="School Website">
     <linkprefix></linkprefix>
     <linksuffix></linksuffix>
     <iconfield></iconfield>
     <iconprefix></iconprefix>
     <iconsuffix></iconsuffix>
    </link>
   </links>


I am NOT getting the default icon int he search results window. I do get the link in the popup and the link in the datagrid (I have that setup in fields).
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Hi Mark,

Did you figure this out yet?
I changed visible="true" to visible="false" in SearchWidget.mxml line 3653. After that, "add search tolerance to point search" was set to "checked" by default.
        <s:Group id="spatialInput"
                 width="100%" height="100%"
                 visible="false"
                 visible.spatialInput="true">
            <s:layout>

Heena
Village of Algonquin, IL


Henna,

    Have you set the new
<tolerancebydefault>true</tolerancebydefault>
in the SearchWidget.xml?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Robert,

I have a question. I just switched one of my esearch widgets over to the new 2.5.0.7 XML format. This is how I setup the link:

<links>
                <link includeinresults="false" field="WEB_URL" alias="School Website">
                    <linkprefix></linkprefix>
                    <linksuffix></linksuffix>
                    <iconfield></iconfield>
                    <iconprefix></iconprefix>
                    <iconsuffix></iconsuffix>
                </link>
            </links>
I am NOT getting the default icon int he search results window. I do get the link in the popup and the link in the datagrid (I have that setup in fields).


Simon,

   that is a bug and will be fixed in version 2.5.0.8. Sorry for the inconvenience. Version 2.5.0.8 Now Available 12/30/11 9pm Central time.
0 Kudos