Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

138371
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
EricVenden
Frequent Contributor
Robert,
Yes, the folder is:

widgets/eSearch/assets/images

I then have folders under widgets/eSearch/ for all the different searches, such as:

widgets/eSearch/ParcelSearch/

Each of these folders contains the SearchWidget.xml and SearchWidget.swf files.
Thank you
Eric
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

   That is the issue then... You will have to have a copy of the assets folder under each sub folder of eSearch unless you comment out this line in the SearchWidget.mxml

WIDGET_URL = config.substring(0,config.lastIndexOf("/")) + "/assets/images/";


This line is looking at the xml file and saying that it's path plus /assets/images/ is where the icons are.
0 Kudos
EricVenden
Frequent Contributor
Ugh..easy...thank you Robert.
Eric
0 Kudos
DerekHunter
Emerging Contributor
Robert,

We are accessing a map service via a page in our non-GIS site at http://www.fairfield-city.org/parks/golf_map.cfm and too are getting the 2124 error. We can click OK and it works, but all of our widgets are missing.  Any suggestions?  Reading through this thread I wasn';t able to determine what is causing this.  We are not using the search widget, just the draw/measure, print, mapswitcher, nav, coord and headercontroller.

Derek Hunter

Good Morning Robert,

Hope all is well.

I replaced version 2.2.3 with 2.2.7 and run it out of the box, with your xml file and no other changes, just to test prior to using my xml file. When I fire off the widget, I get an Error # 2124. I can click OK and the widget works fine otherwise. When I use my xml file I get the same error including no popup when I put the hand cursor over a selected feature.

Any suggestions?

Thanks for the great enhancements ...

Nestor.
0 Kudos
GarrettMoeller
Deactivated User
Greetings,
I have the out-of-the-box search widget working well.
What I would like now are some simple customizations.
I have Flash Builder if necessary.
Please point me in the right direction.

In the results table, I would like it to output, not just what you queried, but also additional
Fields related to the query.
For example, my query searches for a tract number - which it displays properly in the results table.
What I would also like is it to display Acres (which is another field associated with this tract).

Thank you
0 Kudos
philippschnetzer
Frequent Contributor
Having an issue trying to get the search to work with SUBTYPES and domains coming from an SDE.  I cannot get domains to show and subtypes (which are coded integer values in an integer field) also do not show in a combo box if I set usedomain="true".  I have configured my xml to conform to the example given in the latest download:
<
expression alias="Category" textsearchlabel="Search by CATEGORY [ Example: CHURCH ]:" field="CATEGORY" usedomain="true">CATEGORY = '[value]'</expression>  


Am I missing something to make this work for SDE?  Does this tool not work with subtypes?  Below is a portion of my services directory - I have noticed that the domains are listed separately and not included in the same line where the fields are listed:
Fields:
OBJECTID (Type: esriFieldTypeOID, Alias: OBJECTID)
PILLAR (Type: esriFieldTypeString, Alias: ICSP Pillar, Length: 20 )
CATEGORY (Type: esriFieldTypeSmallInteger, Alias: Category of Asset)
SUB_CATEGORY (Type: esriFieldTypeString, Alias: Type of Asset, Length: 30 )
NAME_ASSET (Type: esriFieldTypeString, Alias: Name of Asset, Length: 40 )
STR_NAME (Type: esriFieldTypeString, Alias: Street Name, Length: 30 )
STR_TYPE (Type: esriFieldTypeString, Alias: Street Type, Length: 30 )
COMMUNITY (Type: esriFieldTypeString, Alias: Name of Community, Length: 30 )
STATUS (Type: esriFieldTypeString, Alias: Operational Season, Length: 15 )
CONTACT (Type: esriFieldTypeString, Alias: Primary Contact Name, Length: 40 )
MAIL_ADDRESS (Type: esriFieldTypeString, Alias: Mailing Address, Length: 40 )
POSTAL (Type: esriFieldTypeString, Alias: Postal Code, Length: 10 )
PHONE (Type: esriFieldTypeString, Alias: Phone Number, Length: 15 )
OCCUPANCY (Type: esriFieldTypeSmallInteger, Alias: Occupancy of Facility)
VOLUNTEER (Type: esriFieldTypeString, Alias: Volunteer Sector Activity, Length: 5 )
REVIEW_LINK (Type: esriFieldTypeString, Alias: Link to Reviews, Length: 50 )
PLACES_LINK (Type: esriFieldTypeString, Alias: Link to Google Places, Length: 50 )
CDA_NAME (Type: esriFieldTypeString, Alias: Community Development Association, Length: 30 )
ELECT_NAME (Type: esriFieldTypeString, Alias: Electoral District, Length: 20 )
COLLECTOR (Type: esriFieldTypeString, Alias: Name of Data Collector, Length: 30 )
COL_DATE (Type: esriFieldTypeDate, Alias: Date of Collection, Length: 36 )
EDITOR (Type: esriFieldTypeString, Alias: Name of Data Editor, Length: 30 )
EMAIL (Type: esriFieldTypeString, Alias: Email Address for Asset, Length: 40 )
SHAPE (Type: esriFieldTypeGeometry, Alias: SHAPE)
CIVIC_NUM (Type: esriFieldTypeInteger, Alias: Civic Number)
YEAR_EST (Type: esriFieldTypeInteger, Alias: Year Established)
EMPLOYEE (Type: esriFieldTypeSmallInteger, Alias: Number of Employees)
KEWORD (Type: esriFieldTypeString, Alias: Keyword Search, Length: 200 )
DESCRIPT (Type: esriFieldTypeString, Alias: Description, Length: 254 )
NOTES (Type: esriFieldTypeString, Alias: Notes on Asset, Length: 254 )
WEB_LINK (Type: esriFieldTypeString, Alias: Web Address for Asset, Length: 100 )
PHOTO_LINK (Type: esriFieldTypeString, Alias: Link to Photogragh, Length: 100 )
VIDEO_LINK (Type: esriFieldTypeString, Alias: Link to Video, Length: 100 )
WIKI_LINK (Type: esriFieldTypeString, Alias: Link to Wikipedia, Length: 100 )
Type ID Field: CATEGORY

Types: 
ID: 310
Name: Active Healthy Living
Domains: 
Field Name: SUB_CATEGORY
Coded Values:[Active Healthy Living: Active Healthy Living]
Field Name: CDA_NAME
Coded Values:[Meat Cove: Meat Cove], [Pleasant Bay: Pleasant Bay], [Cheticamp: Cheticamp], ...13 more...
Field Name: ELECT_NAME
Coded Values:[1: District 1], [2: District 2], [3: District 3], ...3 more...
ID: 320
Name: Gatherings & Festivals
Domains: 
Field Name: SUB_CATEGORY
Coded Values:[Festivals: Festivals], [Gatherings: Gatherings], [Events: Events], ...1 more...
Field Name: CDA_NAME
Coded Values:[Meat Cove: Meat Cove], [Pleasant Bay: Pleasant Bay], [Cheticamp: Cheticamp], ...13 more...
Field Name: ELECT_NAME
Coded Values:[1: District 1], [2: District 2], [3: District 3], ...3 more...
ID: 330
Name: Recreation Centres
Domains: 
Field Name: SUB_CATEGORY
Coded Values:[Rink: Rink], [Curling: Curling Rink], [Track & Field: Track & Field], ...6 more...
Field Name: CDA_NAME
Coded Values:[Meat Cove: Meat Cove], [Pleasant Bay: Pleasant Bay], [Cheticamp: Cheticamp], ...13 more...
Field Name: ELECT_NAME
Coded Values:[1: District 1], [2: District 2], [3: District 3], ...3 more...


Thanks for any help!
0 Kudos
AshleyOwens
Emerging Contributor
I am attempting to utilize the 2.1 SearchWidget, specifically the spatialInput piece. I would like to be able to search spatially, involving buffering capabilities.

The widget loads fine (I have it set to currentState="spatialInput"), and I am able to make my selections, but when I click "Search", the widget spins for a very long time, never returning (I close the browser after more than 10 minutes). When I put in trace statements, the thread never makes it to function bufferCompleteHandler.

Any help is appreciated!
0 Kudos
SandeepTalasila
Occasional Contributor
Jim, 

Hopefully version 2.2.5 will come out today and it will have all of this configurable. 

i.e disablebuttons, defaultselectionoption, toleranceforpointgraphicalselection, text search by selecting from valid domain values in a combobox when this option is set in config. 

If you need it fixed right away then the code change would be: 

<viewer:BaseWidget xmlns:esri   ="http://www.esri.com/2008/ags"
       xmlns:fx    ="http://ns.adobe.com/mxml/2009"
       xmlns:s    ="library://ns.adobe.com/flex/spark"
       xmlns:mx    ="library://ns.adobe.com/flex/mx"
       xmlns:mxeffects      ="com.adobe.ac.mxeffects.*"
       xmlns:viewer         ="com.esri.viewer.*"
       xmlns:Search        ="widgets.eSearch.*"
       x="600" y="300"
       currentState="textInput"
       widgetConfigLoaded="init()">
 <viewer:states>
  <s:State name="graphicalInput"/>
  <s:State name="textInput"/>
  <s:State name="spatialInput" />
  <s:State name="resultsList"/>
 </viewer:states>


Use one of the other State names instead.


Hi Robert,
I am using your enhanced search widget 2.3.1 and was trying to set the default state to graphical input instead of text input. I have changed the code as
currentState="graphicalInput"
private var lState:String = "graphicalInput";
----and also---- 
defaultSelectionOption = configXML.defaultselectionoption || "graphicalInput";

I can see graphical input when the map loads, but it immediately switches back to text input. May be I am missing something. Could you please let me know if I have to make changes any where else in the code.
Thanks,
0 Kudos
SandeepTalasila
Occasional Contributor
Robert,
I also want to bring it to your notice that after performing graphical search and clearing the results, the icon underlined is text search but the active state shown is graphical search. And with the text search after clearing the results, results icon is underlined but the displayed state is text input. I wonder whether anyone have noticed this or its just happening in my app. Please see the attached images. Thanks!

*** I have figured this out, and it was an error at my end... I have changed the order of the icons to display grid table icon at the end, and it is the reason for the error. If you don't mind could you explain this to me. Thanks.

if(!disGra)
     wTemplate.addTitlebarButton(ICON_URL + "i_searchgraphical.png", graphicalsearchLabel, showStateGraphicalSearch);
    if (configSearchText.length && disText != true)
     wTemplate.addTitlebarButton(ICON_URL + "i_searchtext.png", textsearchLabel, showStateTextSearch);
    //if (configSpatialSearchLayers.length && disSpat != true)
    // wTemplate.addTitlebarButton(WIDGET_URL + "i_searchspatial.png", spatialsearchLabel, showStateSpatialSearch);
    if(!disGrid){
     wTemplate.addTitlebarButton(ICON_URL + "i_table.png", resultsLabel, showStateResults)};
    wTemplate.addTitlebarButton(ICON_URL + "i_table2.png", gridresultsLabel,showGridResults,false);
0 Kudos
JonFisher
Emerging Contributor
Hi Robert,
I am using your enhanced search widget 2.3.1 and was trying to set the default state to graphical input instead of text input.


Any reason you wouldn't simply use the <defaultselectionoption> in the xml and set it to "textInput"? That worked well for me.
0 Kudos