Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part III

143910
776
04-30-2013 03:58 PM
RobertScheitlin__GISP
MVP Emeritus
All,

   Here is a new thread to post questions and discuss the Enhanched Search Widget. The old thread was getting too long.
Tags (2)
776 Replies
MichaelVolz
Esteemed Contributor

Robert:

I believe I am using the 3.5 version of your E-Search widget, but I am not 100% sure and I cannot remember how to get this information.

Also, this version was running fine against AGS v10.0 services and now I am testing it against AGS v10.2 services, but it is not returning results.  Does E-Search v3.5 support AGS v10.2 services?

Your feedback is greatly appreciated.  Thanks

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

   You can check which version of the widget you are using by holding the Alt key and clicking on the widget name. Yes 3.5 supports 10.2 services

0 Kudos
MichaelVolz
Esteemed Contributor

Thank you Robert.

Does the Enhanced Search widget use a geometry service?  If so, is it an ESRI public geometry service?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

     It uses what ever geometry service that you setup in your viewers main config.xml

0 Kudos
MichaelVolz
Esteemed Contributor

Thank you Robert.  It has been awhile since I have looked at the FlexViewer software and I forgot that a geometry service is configured in the main config file for the overall application.

Is it difficult to add new parameters to a config file and modify an existing mxml file to read in the parameters?  Do you know of good documentation that would help in this endeavor?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Michael,

  No it is not difficult, but I don't know of any docs on it. Just open the mxml and find the init function (or what ever that widget calls when the widgetConfigLoaded event fires and you will see several lines like:

csvSep = configXML.csvseparator || ",";

the csvseperator is the xml element in the widgets config xml file that is being retrieved.

0 Kudos
AngieAllison
Emerging Contributor
Marie,

   So in Version 3.0 there is some issue you are going to have to work around. You need to use uniquevalsfromfield instead of domain as using domain in 3.0 will force you to have a value for each domain field. The next issue you will have to Just deal with in version 3.0 is that once you have chosen a value from the dropdown list the search will automatically be executed (this was fixed in latter releases). I am going to assume that your diameter field is numeric and not a string and I adjusted your expression for that assumption.

Here is a corrected configuration for your layer:

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Water Mains</name>
            <url>http://gis-01/ArcGIS/rest/services/MAP_DOCS/dmww_water_server/MapServer/23</url>
            <expressions>
                <expression alias="Material,Diameter and Install Date" textsearchlabel="Search Material:" isvaluerequired="false">
                    <values>
                        <value prompt="Material" uniquevalsfromfield="MATERIAL" isvaluerequired="false">MATERIAL = '[value]'</value>
                        <value prompt="Diameter" uniquevalsfromfield="DIAMETER" isvaluerequired="false" operator="AND">DIAMETER = [value]</value>
                        <value prompt="Example: 01/01/2007 Install Date" isvaluerequired="false" operator="AND">INSTALLDATE >= date '[value] 00:00:00'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Water Mains</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="DIAMETER" gridfield="true" />
                <field name="FACILITYID" gridfield="true" />
                <field name="MATERIAL" gridfield="true" />
                <field name="INSTALLDATE" gridfield="true" dateformat="MM/DD/YYYY" useutc="true" />
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="1.6"></zoomscale>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
            <symbology>
                <simplelinesymbol color="0x00ff00" alpha="0.8" width="2" />
            </symbology>
        </layer>


yes i saw that on the diameter u are correct.  i did try the uniquevalsfromfield="MATERIAL" and it takes a long time to load the values.  Thanks for your answeres i will look at upgrading to the newest version.  is that 3.3?
0 Kudos
AngieAllison
Emerging Contributor
Marie,

   So in Version 3.0 there is some issue you are going to have to work around. You need to use uniquevalsfromfield instead of domain as using domain in 3.0 will force you to have a value for each domain field. The next issue you will have to Just deal with in version 3.0 is that once you have chosen a value from the dropdown list the search will automatically be executed (this was fixed in latter releases). I am going to assume that your diameter field is numeric and not a string and I adjusted your expression for that assumption.

Here is a corrected configuration for your layer:

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Water Mains</name>
            <url>http://gis-01/ArcGIS/rest/services/MAP_DOCS/dmww_water_server/MapServer/23</url>
            <expressions>
                <expression alias="Material,Diameter and Install Date" textsearchlabel="Search Material:" isvaluerequired="false">
                    <values>
                        <value prompt="Material" uniquevalsfromfield="MATERIAL" isvaluerequired="false">MATERIAL = '[value]'</value>
                        <value prompt="Diameter" uniquevalsfromfield="DIAMETER" isvaluerequired="false" operator="AND">DIAMETER = [value]</value>
                        <value prompt="Example: 01/01/2007 Install Date" isvaluerequired="false" operator="AND">INSTALLDATE >= date '[value] 00:00:00'</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Water Mains</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>FACILITYID</titlefield>
            <fields all="false">
                <field name="DIAMETER" gridfield="true" />
                <field name="FACILITYID" gridfield="true" />
                <field name="MATERIAL" gridfield="true" />
                <field name="INSTALLDATE" gridfield="true" dateformat="MM/DD/YYYY" useutc="true" />
            </fields>
            <links/>
            <zoomscale usegeometry="true" zoompercent="1.6"></zoomscale>
            <autoopendatagrid>false</autoopendatagrid>
            <queryattachments>false</queryattachments>
            <relates/>
            <symbology>
                <simplelinesymbol color="0x00ff00" alpha="0.8" width="2" />
            </symbology>
        </layer>


Also - the date value that you changed??  i am trying to do a greater than or equal to on the date and it seemed to be working the way i had it.  is it wrong??  Is it possible to do a "between" dates ??
0 Kudos
MATTHEWPORTER
Deactivated User
Are there any issues when using a attribute field with a coded domain. I get an error 400 when i do a search.
               
                <expression alias="Access Status" textsearchlabel="Search Access Status:">
                    <values>
                        <value userlist="Property Acquired,Est. Access Date Exceeded">AquisitionCode = '[value]'</value>
                    </values>
                </expression>

I am thinking that = '[value]' should be something else like domain?

Thanks!

Matt
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Marie,

   If you had the date working before than leave it the way you had it. Doing a date range is quite a bit more difficult. You can do it but you would have to hard code one of the dates or use two expressions values. You should do your SQL expression testing in ArcMap to figure out the exact language.
0 Kudos