Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part III

143845
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
BrentFoster
Emerging Contributor

I'm using an out of the box Flex Viewer, nothing custom or proprietary.  So my main config file looks like this:  (I have my various searches grouped)  The top search, set to open on startup, is the one that I use to zoom to the predefined parameter.  The others are simply other searches setup to use other map services. 

<widgetgroup label="Search" icon="assets/images/i_search.png">

<widget label="TDM Search" left="80" top="280"

                icon="assets/images/i_search.png"

                preload="open"

                config="widgets/eSearch/eSearchWidget_TDM.xml"

                url="widgets/eSearch/eSearchWidget.swf"/>

<widget label="Township Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/eSearchWidget_Townships.xml"
                url="widgets/eSearch/eSearchWidget.swf"/>

<widget label="Texas Landgrid Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/eSearchWidget_Abstracts.xml"
                url="widgets/eSearch/eSearchWidget.swf"/>

<widget label="Well Activity Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/eSearchWidget_Well_Activity.xml"
                url="widgets/eSearch/eSearchWidget.swf"/>

<widget label="TEL Leases" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/eSearchWidget_Leases.xml"
                url="widgets/eSearch/eSearchWidget.swf"/>
   
<widget label="Contract Search" left="80" top="280"
                icon="assets/images/i_search.png"
                config="widgets/eSearch/eSearchWidget_Contracts.xml"
                url="widgets/Searches/eSearchWidget.swf"/>

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Brent,

   OK, now I see. So you ARE using multiple eSearchWidgets based on the fact that you have several widget tags pointing to the eSearchWidget.swf. Each widget tag will create a new instance of the eSearch widget and just use a different xml configuration. So my first question is why are you doing it this way and not just using one widget with the multiple different searches configured in the one eSearchWidget.xml? You can have the eSearch widget configured to use many different map services and each map service can have multiple expressions defined, all in one eSearch widget.

As I mentioned before the eSearch widget is working as designed. When the eSearch widget (does not matter which one in your app) is launched it checks for the existence of the esearch parameter in the url and if it finds one then it executes that search. So the way you have your app configured each eSearch widget will do the URL search.

0 Kudos
BrentFoster
Emerging Contributor

Ok that makes sense Robert.  I'll have to combine all of my searches into one eSearch xml in order to get this to work properly.  We had reasons at the time for separating them out, but combining them will work fine in this case.  Thanks for the great work, you should start a crowd funding site for your new JavaScript project, I bet you'd have a lot of interest. 

Much thanks, Brent

0 Kudos
AaronKreag
Deactivated User

Brent-

If you need some help email me akreag at bisconsultants dot com

I have a degree of empathy. ☺

0 Kudos
AndrewNiederhauser1
Deactivated User

Hi Robert,

Trying to export parcel PIN results from the advanced search widget to .csv file and am getting some odd results when I open the .csv in Excel.

The field type for the PIN field is string (30) but when I open it in Excel, it has the odd format below (2.93022E+11). If I format the Excel cells to Number then the PIN comes through fine (see the highlighted cells below).

So my thought was to add the numberformat="2|,|." tag for that particular field but still can't get it to work. I assume that is b/c the numberformat field tag won't work on a string field. Any advice?

Parcels_in_Excel_from_CSV.png

Below is a snippet from the esearch widget XML file.

        <layer>

            <token/>

            <definitionexpression/>

            <enableexport>true</enableexport>

            <name>Parcels</name>

            <url>https://gis.sehinc.com/seh/rest/services/AnywhereUSA/AnywhereUSA_Basemap/MapServer/20</url>

            <expressions>

                <expression alias="Parcel ID" textsearchlabel="Search by Parcel ID:" isvaluerequired="true">

                    <values>

                        <value prompt="Example: 293022340034" isvaluerequired="true" autosubmit="false">PARCELID LIKE '%[value]%'</value>

                    </values>

                </expression>

                <expression alias="Site Address" textsearchlabel="Search by Site Address:" isvaluerequired="true">

                    <values>

                        <value prompt="Example: 3535 Vadnais Center Dr" isvaluerequired="true" autosubmit="false">upper(SITEADDRESS) LIKE upper('%[value]%')</value>

                    </values>

                </expression>

                <expression alias="Owner Name" textsearchlabel="Search by Owner Name:" isvaluerequired="true">

                    <values>

                        <value prompt="Example: Sofia Ruxin" isvaluerequired="true" autosubmit="false">upper(OWNERNME1) LIKE upper('%[value]%')</value>

                    </values>

                </expression>

            </expressions>

            <graphicalsearchlabel>Use one of the graphical search tools to select Projects</graphicalsearchlabel>

            <spatialsearchlayer>true</spatialsearchlayer>

            <titlefield>PARCELID</titlefield>

            <fields all="false">

                <field name="PARCELID" gridfield="true"/>

                <field name="SITEADDRESS" gridfield="true"/>

                <field name="SITECITYSTATEZIP" gridfield="true"/>

                <field name="OWNERNME1" gridfield="true"/>

                <field name="OWNERNME2" gridfield="true"/>

                <field name="PSTLADDRESS" gridfield="true"/>

                <field name="OWNERCITYSTATEZIP" gridfield="true"/>

            </fields>

            <links/>

            <zoomscale usegeometry="true" zoompercent="1.6"/>

            <autoopendatagrid>true</autoopendatagrid>

            <queryattachments>true</queryattachments>

        </layer>

Thanks,

Andrew

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Andrew,

   This all on excel If you open the file in notepad you will see that the parcel id field does show the proper string value. Excel is interpreting the string as a number (it does that on it's own) and thus you see the scientific numbers in excel.

0 Kudos
AndrewNiederhauser1
Deactivated User

Ok. Unfortunate. Any thoughts on work-arounds? Thanks for the reply.

0 Kudos
RhettZufelt
MVP Notable Contributor

Hey Robert,

It's probably been discussed, but I can't seem to find it on the new forum, so figured I'd just ask.

Wondering what controls the width of the dropdowns when using uniquevalues?

clip.jpg

Both of the fields I have here are the same width, but the dropdowns are not.  Plus, they are way wider than need be.  Is there some way to control this?

Thanks,

R_

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rhett,

  This function handles that.

            /*

            * Set the width of the DropDown to account for the longest text in the Data Provider

            *    @param Object arr the data provider of the drop down

            *    @return Number the max length needed

            */

            protected function determineDropDownWidth(arr:Object):Number

            {

                var maxLength:Number = 0;

                var i:int=0;

                for ( i = 0; i < arr.length; i++ ) {

                    var o:Object = arr;

                    if ( ObjectUtil.isSimple(o["label"]) ) {

                        var cellMetrics:TextLineMetrics = lblLayerText.measureText(o["label"]+"");

                        if ( cellMetrics.width + 40 > maxLength ) {

                            maxLength = cellMetrics.width + 40;

                        }

                    }

                }

                return maxLength;

            }

0 Kudos
NicholasMcNamara
Frequent Contributor

I just upgraded to 3.7 and have eSearch running. It seems to be working OK and I figured I'd give you some feedback on the UI for some minor fixes for a future version:

Default Symbology:

setting for angle is off the page and cannot be set through my UI (picture marker symbology)

when editing a layer in update search layer, some buttons and text boxes overlap the text labels

General Options section:

typo: "Show multi-prat graphics search"

typo: "CSV Seperator"

Default labels section:

typo: "Add Tollerance Text"

typo: "Configure Buffer Grpahics Properties Text"

0 Kudos