Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

136595
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
All,

   Version 2.5 now available for Flex Viewer 2.5

Version 2.5 - 12/2/2011
  * Added Related table display capabilities for searched features
  * Added support for domains that come from subtypes.
0 Kudos
KenCarrier
Deactivated User
Robert,

I am still getting an error when trying to use these two tags "usedomains" and "fromsubtype". Any help would be greatly appreciated. I using the same rest endpoint specified in previous post. I am using the latest 2.5 eSearch widget and have updated my compiler with the latest version of the Flex API.

Error:
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()

SearchWidget.xml:
<layer>
  <definitionexpression></definitionexpression>
  <enableexport>true</enableexport>
  <name>Available Land</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="PROPTYPE" usedomain="true" fromsubtype="true">PROPTYPE = '[value]'</expression>
  </expressions>
  <graphicalsearchlabel>Use one of the graphical search tools to select Available Land</graphicalsearchlabel>
  <spatialsearchlayer>true</spatialsearchlayer>
  <titlefield>BCOMPANY</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>



All,

   Version 2.5 now available for Flex Viewer 2.5

Version 2.5 - 12/2/2011
  * Added Related table display capabilities for searched features
  * Added support for domains that come from subtypes.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

    The issue is that you are specifying the subtype field and I need the field name that contains the domain.

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Available Land</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" fromsubtype="true">PROPTYPE = '[value]'
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select
                Available Land</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>BCOMPANY</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>
0 Kudos
KenCarrier
Deactivated User
Robert,

Thank you I have gotten past that error and understand it better now. The query is still not working as expected. Here is the new config. I wanted to implement a multi field search but I think in previous posts you have mentioned this is not possible. So for example select PROPTYPE then based on the PROPTYPE select AGREAGE from the subtype. To get around this I thought I would just use a definitionexpression. Here is the code I have so far. I apologize for my ignorance hopefully this will help someone else in the future.

Error:
[RPC Fault faultstring="Unable to complete operation" faultCode="400" faultDetail="Unable to complete Query operation."]

SearchWidget.xml

<layer>
  <definitionexpression>PROPTYPE = 2</definitionexpression>
  <enableexport>true</enableexport>
  <name>Available Land Agricultural</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" fromsubtype="true">ACREAGEDOM = '[value]'</expression>
  </expressions>
  <graphicalsearchlabel>Use one of the graphical search tools to select Available Land</graphicalsearchlabel>
  <spatialsearchlayer>true</spatialsearchlayer>
  <titlefield>PARID</titlefield>
  <fields all="true">
    <!--
    <field name="PARID" gridfield="true"/>
    <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>

Ken,

    The issue is that you are specifying the subtype field and I need the field name that contains the domain.

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Available Land</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" fromsubtype="true">PROPTYPE = '[value]'
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select
                Available Land</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>BCOMPANY</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>
0 Kudos
KenCarrier
Deactivated User
Robert,

I figured it out, because I am using a coded value domain of type Short Integer, the single quotes around [value] were what was causing the problem with the search. If it were text then it would work. Thank you again for all your help it is greatly appreciated.

Does not work with Coded Value Domain on Short Integer field:
<expression alias="Available Land Agriculture" textsearchlabel="Search Available Land Agriculture by Acreage..." field="ACREAGEDOM" usedomain="true" fromsubtype="true">ACREAGEDOM = '[value]'</expression>

Works with Coded Value Domain on Short Integer field:
<expression alias="Available Land Agriculture" textsearchlabel="Search Available Land Agriculture by Acreage..." field="ACREAGEDOM" usedomain="true" fromsubtype="true">ACREAGEDOM = [value]</expression>
0 Kudos
KenCarrier
Deactivated User
Robert,

Is it possible to have more than one linkfield or specify multiple linkfields?

<linkfield linkaliastext="Brochure Link: Get More Info">HYPERLINK</linkfield>
<linkfield linkaliastext="Auditor Link: Get More Info">AUDHYPLNK</linkfield>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   No there is no support for multiple link fields. Some people have extended the code themselves to add this ability, so it is possible.
0 Kudos
KenCarrier
Deactivated User
Robert,

I think I might have found a possible bug. In the attached screen shot you will notice that the datagrid is showing the subtype number instead of the description. In the other windows the subtype description is used instead of the number. Hope this helps.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   That is fixed in Version 2.5.0.1 (now Available).
0 Kudos
KenCarrier
Deactivated User
Thanks Robert!
0 Kudos