Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

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

   have you looked at the sum capability of the eSearch datagrid?

<field name="Length_" numberformat="2|,|." sum="true" sumlabel="Total Length: " gridfield="true"/>


Thank you so very much!! I have not tried it yet but I am excited to!!! I also wanted to let you know that your widgets alone have enabled us to bring GIS to over 100 users within our organization, thank you very much and have a great thanksgiving.
0 Kudos
CaitlinBernier
Emerging Contributor
Hi Robert,
I wondered if there is a way to append to selection set using the enhanced search widget?  If I select a subdivision boundary using the point select tool in the graphical search tools and then use the spatial search tools and select the parcels that are entirely contained within the subdivision boundary, I get all but three parcels.  Obviously, our subdivision boundary needs to be corrected, but in the meantime, I would like to be able to add those three parcels to the selection set so I can export all of them to a csv from your datagrid table.
Thanks,
Caitlin
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Caitlin,

     Currently No and it is not going to make it into the 2.5 version of the widget either.
0 Kudos
KenCarrier
Deactivated User
Robert, here is my code in the SearchWidget.xml

<layer>
  <definitionexpression></definitionexpression>
  <enableexport>true</enableexport>
  <name>Available</name>
  <url>http://gis.monroeohio.org/MONGIS/rest/services/AvailableLand/MapServer/1</url>
  <expressions>
   <expression alias="Available Land Agriculture" textsearchlabel="Search Available Land Agriculture by Acreage..." field="ACREAGEDOM" usedomain="true">UPPER(ACREAGEDOM) = UPPER('[value]')</expression>
  </expressions>
  <graphicalsearchlabel>Use one of the graphical search tools to select Available Land</graphicalsearchlabel>
  <spatialsearchlayer>true</spatialsearchlayer>
  <titlefield>COMPANY</titlefield>
  <fields all="false">
    <field name="BCOMPANY" gridfield="true"/>
    <field name="BNAME" gridfield="true"/>
    <field name="BPHONE" gridfield="true"/>
    <field name="BFAX" gridfield="true"/>
    <field name="BEMAIL" gridfield="true"/>
    <field name="PROPNAME" gridfield="true"/>
    <field name="ZONE" gridfield="true"/>
    <field name="ACRES" gridfield="true"/>
    <field name="PARID" gridfield="true"/>
    <field name="OWNER" gridfield="true"/>
    <field name="COMMENTS" gridfield="true"/>
    <field name="PROPTYPE" gridfield="true"/>
    <field name="LATITUDE" gridfield="true"/>
    <field name="LONGITUDE" gridfield="true"/>
    <field name="ADDRESS" gridfield="true"/>
    <field name="HYPERLINK" gridfield="true"/>
    <field name="AUDHYPLNK" gridfield="true"/>
  </fields>
  <linkfield></linkfield>
  <icon isfield="false"></icon>
  <zoomscale usegeometry="true"/>
  <autoopendatagrid>true</autoopendatagrid>
</layer>

Here is the error I am receiving in Firefox:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.eSearch::SearchWidget/popCBwithDomain()
at widgets.eSearch::SearchWidget/searchLayerChangedText()
at widgets.eSearch::SearchWidget/__cboLayerText_change()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.controls::ComboBox/dispatchChangeEvent()
at mx.controls::ComboBox/close()
at mx.controls::ComboBox/dropdown_changeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.controls.listClasses::ListBase/mouseUpHandler()
at mx.controls::List/mouseUpHandler()

Any thoughts on what I might be doing wrong here?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   If you bring up your REST Service directory for this layer does the ACREAGEDOM field show the coded values like this:

Surf_Type (Type: esriFieldTypeSmallInteger, Alias: Surface Type, Domain: Coded Values: [1: Tar and Gravel], [2: Asphalt], [3: Chert], ...2 more... )
0 Kudos
KenCarrier
Deactivated User
One thing I failed to mention, the domains exist on subtypes not on the default field, could that be causing the issue? I reviewed the SearchWidget.mxml code, I am not a Flex developer but I did not see any error trapping for subtypes within the code, although I might have missed it.

Robert, here is my code in the SearchWidget.xml

<layer>
  <definitionexpression></definitionexpression>
  <enableexport>true</enableexport>
  <name>Available</name>
  <url>http://gis.monroeohio.org/MONGIS/rest/services/AvailableLand/MapServer/1</url>
  <expressions>
   <expression alias="Available Land Agriculture" textsearchlabel="Search Available Land Agriculture by Acreage..." field="ACREAGEDOM" usedomain="true">UPPER(ACREAGEDOM) = UPPER('[value]')</expression>
  </expressions>
  <graphicalsearchlabel>Use one of the graphical search tools to select Available Land</graphicalsearchlabel>
  <spatialsearchlayer>true</spatialsearchlayer>
  <titlefield>COMPANY</titlefield>
  <fields all="false">
    <field name="BCOMPANY" gridfield="true"/>
    <field name="BNAME" gridfield="true"/>
    <field name="BPHONE" gridfield="true"/>
    <field name="BFAX" gridfield="true"/>
    <field name="BEMAIL" gridfield="true"/>
    <field name="PROPNAME" gridfield="true"/>
    <field name="ZONE" gridfield="true"/>
    <field name="ACRES" gridfield="true"/>
    <field name="PARID" gridfield="true"/>
    <field name="OWNER" gridfield="true"/>
    <field name="COMMENTS" gridfield="true"/>
    <field name="PROPTYPE" gridfield="true"/>
    <field name="LATITUDE" gridfield="true"/>
    <field name="LONGITUDE" gridfield="true"/>
    <field name="ADDRESS" gridfield="true"/>
    <field name="HYPERLINK" gridfield="true"/>
    <field name="AUDHYPLNK" gridfield="true"/>
  </fields>
  <linkfield></linkfield>
  <icon isfield="false"></icon>
  <zoomscale usegeometry="true"/>
  <autoopendatagrid>true</autoopendatagrid>
</layer>

Here is the error I am receiving in Firefox:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at widgets.eSearch::SearchWidget/popCBwithDomain()
at widgets.eSearch::SearchWidget/searchLayerChangedText()
at widgets.eSearch::SearchWidget/__cboLayerText_change()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.controls::ComboBox/dispatchChangeEvent()
at mx.controls::ComboBox/close()
at mx.controls::ComboBox/dropdown_changeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()
at mx.controls.listClasses::ListBase/mouseUpHandler()
at mx.controls::List/mouseUpHandler()

Any thoughts on what I might be doing wrong here?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Ken it could be subtypes as I don't use those and probably have not accounted for them in the code. Is your data with subtypes public?
0 Kudos
KenCarrier
Deactivated User
Robert,

I am not sure what you mean by public, it is a public facing website.

I tried setting up the domain on the default field as well as the subtype but still no luck.

I basically have 3 subtypes pertaining to the type of land i.e.(RESIDENTIAL,COMMERICIAL,AGRICULTURAL). Within each subtype I use a domain, it is the same domain. I tried setting the domain on the field instead of just the subtype but still get the same error. I am currently developing on a local machine. So the functionality I mentioned is not public facing yet.

I know you are busy and this might only pertain to me currently, but do you think adding this functionality might help others within the community?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   I am sure it would be benificial to others and I am working on the version 2.5 release so this is good timing. Is the REST service available for me to test against (the way you originally had it with the domain on the subtype)?
0 Kudos
KenCarrier
Deactivated User
Robert,

I have reverted the rest endpoint back to how it was originally with the domains on the subtypes.

Here is the rest url

http://gis.monroeohio.org/MONGIS/rest/services/AvailableLand/MapServer/1

Thank you taking the time to look at this!
0 Kudos