Enhanced Search Widget for FlexViewer 2.1

93124
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
Mark,

   What is your use case for this???... I can't seem to imagine why you would want that.
0 Kudos
MarkHanway1
New Contributor
Robert, I would like the user to only be able to search one or two layers defined in the xml.  Build a buffer, then find seperate point locations defined in the xml spatially within the buffer.

For instance the user would select to search a city or neighborhood layer. The widget zooms to that location from the selection results.  The user can then build a buffer, then spatially find point locations from seperate layers defined in the XML such as Hospitals, Points of Interest, etc. 

The xml already lets you specify which layers can be located spatially, what I would like is to filter out or limit the layers that can be searched on the text input page.  hth...thanks, Mark
0 Kudos
PaulSpahr
New Contributor
Hi Robert,

I'm using the 2.4 version and I'm trying to figure out how to remove the select by point and select by line buttons from the Graphical Search part of the widget. 

Also, is there any way to modify the size of the datagrid and popup windows?

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Paul,

   None of those are possible in the compiled version.
0 Kudos
PaulSpahr
New Contributor
Robert,

ok. 

Thanks for your prompt resoponse.

Paul
0 Kudos
SheriNorton
Occasional Contributor II
Hi Robert,
First - thank you SO much for this widget! I'm using the Compiled version for Flex Viewer 2.4.

I have just one problem that I'm not sure how to tackle (sorry, newbie here):
1. Error message when any of the three Text Search options I've set are selected:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.eSearch::SearchWidget/popCBwithDomain()
at MethodInfo-100()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at com.esri.ags.layers::Layer/setLoaded()
at com.esri.ags.layers::FeatureLayer/initLayer()
at MethodInfo-2361()
at mx.rpc::AsyncResponder/result()
at com.esri.ags.tasks::DetailsTask/handleDetails()
at Function/http://adobe.com/AS3/2006/builtin::call()
at com.esri.ags.tasks::BaseTask/handleResult()
at MethodInfo-2094()
at mx.rpc::Responder/result()
at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyResult()
at mx.rpc.events::ResultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::resultHandler()
at mx.rpc::Responder/result()
at mx.rpc::AsyncRequest/acknowledge()
at DirectHTTPMessageResponder/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()

If I click "Continue" the error clears and the search works just fine!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sheri,
 
  So the TAXID, OWNER1, PROP_ADDR field have a code value or range domain associated with them in your mapservice???... Judging by their names I would not think so. If they in fact do not then remove the field and usedomain attributes from those expressions.
0 Kudos
SheriNorton
Occasional Contributor II
Hi Robert,
You're correct - these are not domains. I adjusted the EXPRESSION as you recommended, but now an Application Error (#1090: XML parser failure: element is malformed) displays when the Flex Viewer loads.

Here's the changed XML code:
<expressions>
<expression alias="Parcel ID" textsearchlabel="Search parcels by ID [Example: 102.6-2-9]" upper(TAXID) LIKE upper('%[value]%')</expression>
       
        <expression alias="Parcel OWNER" textsearchlabel="Search parcels by OWNER [Example: Smith, John]" upper(OWNER1) LIKE upper('%[value]%')</expression>
       
        <expression alias="Parcel LOCATION" textsearchlabel="Search parcels by LOCATION [Example: 139 Pack Forest Rd]" upper(PROP_ADDR) LIKE upper('%[value]%')</expression>

</expressions>


Can you tell if I zapped too much code (or should add additional elements)?

Thanks!!!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Sheri,

  Yep you deleted the right carrot on each...

<expressions>
    <expression alias="Parcel ID" textsearchlabel="Search parcels by ID [Example: 102.6-2-9]"> upper(TAXID) LIKE upper('%[value]%')</expression>
    <expression alias="Parcel OWNER" textsearchlabel="Search parcels by OWNER [Example: Smith, John]"> upper(OWNER1) LIKE upper('%[value]%')</expression>
    <expression alias="Parcel LOCATION" textsearchlabel="Search parcels by LOCATION [Example: 139 Pack Forest Rd]"> upper(PROP_ADDR) LIKE upper('%[value]%')</expression>
</expressions>
0 Kudos
SheriNorton
Occasional Contributor II
Hurray! You're the best (figures it was something little). Many thanks... 😮
0 Kudos