Enhanced Search Widget for FlexViewer 2.1

92986
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
RachelS_
New Contributor III
This is in response to the Point Buffer widget included in the original link for the Search Widget. I've adopted the Point Buffer code and wrote a function to calculate the radius distance I want to apply a buffer for, based on some user inputs via combo boxes.  Instead of using the input text (textInputBuffer) I want the buffer distance to be defined by my function. Is there a way to switch it so that the ApplyBuffer function reads from my function and not the text input?
Thanks!!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rachel,

  Sure I can probably help with that. BUT read the post right before yours... You need to start a new thread.
0 Kudos
RachelS_
New Contributor III
whoop, sorry! turns out i was responding to a  thread from  a while ago. new post duly created.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
I get this error if I minimize the enhanced search widget and then click on a record within the data grid. 
[INDENT]Main Thread (Suspended: RangeError: Error #1125: The index 0 is out of range 0.)  
widgets.eSearch::SearchWidget/highlightDataGroupItem  
widgets.eSearch::SearchWidgetFixedDG/onItemRollOver  
widgets.eSearch::SearchWidgetFixedDG/__resultsGrid_itemRollOver  
flash.events::EventDispatcher/dispatchEventFunction [no source]  
flash.events::EventDispatcher/dispatchEvent [no source]  
mx.core::UIComponent/dispatchEvent [no source]  
mx.controls.listClasses::ListBase/mouseOverHandler [no source]  
mx.controls.listClasses::ListBase/mouseMoveHandler [no source][/INDENT] 

I'm not a flex / flash expert so I could use some help. I would also be interested in removing the onItemRollOver functionality in the DataGrid and making it clickRow instead so it would zoom and showInfoWindow. Having it bound to a click instead of using roll over would improve performance of larger sets of data in the current extent. 

Thank you for your help in advance. 

Dave Jenkins GISP 
jkindave@gmail.com


Dave,

After looking into your error and the LOE for making the datagrid interaction with the widget results configurable, I was able to fix the error and add your enhancement request. Download version 2.5.1.1 and you will find that the grid widget interaction is now configurable, and that click results in the grid will both zoom to the results and show the popup.
0 Kudos
NathanEnge
Esri Contributor
Robert, I'm having a bit of an issue, and trying to figure out what I'm missing. I'm still using the 2.4 esearch. I have a feature class that is joined to a view table via arcmap and published to msd. I can do the text based query, but using the graphic select is no joy. all my the fields are turned on. The graphic search works for another feature class that has no join. any ideas?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nathan,

   It is time to put this 14 page thread to rest (especially now that the MVP program is back running again). Please always start a new post from now on. When you do start a new post make sure you clarify if you are talking about a actual spatial view or just a flat table that the join is made with.
0 Kudos
MattGiles
New Contributor
Hi Robert,
I am using your enhanced search widget and noticed that the layers in the 'search layer' dropdown (Louisville zoning, parcels, etc.) are not in my application. Then i checked in the .xml and noticed that the layers that exist in the dropdown are hardcoded into the xml...
Does this mean that, if i have 50 layers in my application, i have to hardcode each into the widget? There is no way to update the dropdown list dynamically as layers are added / removed, visible/not visible??
0 Kudos
MariaSevier
New Contributor
Hi Robert,

I have looked at this code until I'm cross eyed and looked at several forums to see where the code is incorrect but still can't figure it out.

I keep getting the following error.
"[RPC Fault faultString="Invalid or missing input parameters." faultCode="400" faultDetail=""]

I have run these same queries in the rest environment on the layers in the code and it works just fine there.  I'm not sure what the problem is at this point.

Here is my code (the police district search works but the street tree and catch basin ones get me the error above.).
<layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Street Trees</name>
   <url>http://lwchgis01:6080/arcgis/rest/services/MainInternalMaps/Topo/MapServer/0</url>
   <expressions>
    <expression alias ="Street Trees" textsearchlabel="Search by Tree Number: [ Example: 823]" >TREENO like '[value]'</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Trees</graphicalsearchlabel>
    <spatialsearchlayer>true</spatialsearchlayer>
    <!--titlefield>Tree</titlefield-->
   <fields all="false">
    <field name="TREENO" gridfield="true"/>
    <field name="ADDRESS" gridfield="true"/>
    <field name="SIDE" gridfield="true"/>
    <field name="TYPE" gridfield="true"/>
    <field name="YEAR_PLANTE" gridfield="true"/>
    <field name="ELEC_RECEP" gridfield="true"/>
    <field name="MOVED" gridfield="true"/>
   </fields>
   <linkfield></linkfield>
   <icon isfield="false"></icon>
   <zoomscale usegeometry="false">2500</zoomscale>
   <autoopendatagrid>true</autoopendatagrid>
  </layer>
  <layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Catch Basins</name>
   <url>http://lwchgis01:6080/arcgis/rest/services/MainInternalMaps/StormDrainage2/MapServer/10</url>
   <expressions>
    <expression alias="Catch Basin ID" textsearchlabel="Search by CBID:  [ Example: 421595APAR123]">CBID like upper('[value]')</expression>
    <expression alias="Type of Catch Basin" textsearchlabel="Search by TCB:  [ Example: 1A]">TCB like upper('[value]')</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Catch Basins</graphicalsearchlabel>
    <spatialsearchlayer>true</spatialsearchlayer>
    <!--titlefield>Catch Basin</titlefield-->
   <fields all="false">
    <field name="CBID" gridfield="true"/>
    <field name="TCB" gridfield="true"/>
    <field name="NOP" gridfield="true"/>
    <field name="DIAM" gridfield="true"/>
    <field name="DOCB" gridfield="true"/>
    <field name="DOS" gridfield="true"/>
    <field name="SM" gridfield="true"/>
    <field name="WAT_QUAL" gridfield="true"/>
    <field name="OI" gridfield="true"/>
    <field name="INSTDATE" gridfield="true"/>
    <field name="DL" gridfield="true"/>
    <field name="DRE" gridfield="true"/>
    <field name="LIE" gridfield="true"/>
    <field name="MV" gridfield="true"/>
   </fields>
   <linkfield></linkfield>
   <icon isfield="false"></icon>
   <zoomscale usegeometry="false">25000</zoomscale>
   <autoopendatagrid>true</autoopendatagrid>
  </layer>
  <layer>
   <definitionexpression></definitionexpression>
   <enableexport>true</enableexport>
   <name>Police Districts</name>
   <url>http://lwchgis01:6080/arcgis/rest/services/MainInternalMaps/Police/MapServer/1</url>
   <expressions>
    <expression alias="Police District" textsearchlabel="Search by District  [ Example: LD01]">NEW like upper('[value]')</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Police Districts</graphicalsearchlabel>
    <spatialsearchlayer>true</spatialsearchlayer>
    <titlefield>Precinct</titlefield>
   <fields all="false">
    <field name="NEW" alias="Police District" gridfield="true"/>
    <field name="NAME" gridfield="true"/>
   </fields>
   <linkfield></linkfield>
   <icon isfield="false"></icon>
   <zoomscale usegeometry="false">25000</zoomscale>
   <autoopendatagrid>true</autoopendatagrid>
  </layer>


Thanks for any help that you can provide.
Maria Sevier
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Maria,

  Sure I can help you but you need to post a new thread for every question you have now a days. Once a thread has been answered I will not be answering other questions on that thread. This thread is 14 Pages long and it is time to retire it.
0 Kudos
DavidJenkins
New Contributor III
Dave,

    After looking into your error and the LOE for making the datagrid interaction with the widget results configurable, I was able to fix the error and add your enhancement request. Download version 2.5.1.1 and you will find that the grid widget interaction is now configurable, and that click results in the grid will both zoom to the results and show the popup.


Robert,

Thanks.  I was able to modify the code somewhat on my own by combining the onItemRollOver function into the clickRow function in the SearchWidgetFixedDG.mxml, but I still had range error when I would minimize the widget and click on an item in the grid.  I will try your new release immediately.  You are the man!  Thanks.

Dave
0 Kudos