Select to view content in your preferred language

Enhanced-Search-Widget-for-FlexViewer Part II

136895
552
04-19-2012 08:03 AM
RobertScheitlin__GISP
MVP Emeritus
All,

   I am pleased to announce the next release of my eSearch Widget.

http://www.arcgis.com/home/item.html?id=5d4995ccdb99429185dfd8d8fb2a513e

Version 2.5.1.7 - 4/19/2012
* Added ability to search (flat/standalone/no geometry) tables.
* This time all Zooming uses the same scaling (popup, datagrid, widget results, zoom to all).
* Added Relates icon/button to datagrids so that you can click on it in the datagrid to
  open relates choice dialog.
* Move all skins to a skins package for cleaner organization.
* Links that are not associated with a field now work.
* Ability to disable the relates tab in the fixed widget is now configurable.
552 Replies
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Is there a reason why you have a space behind the field name?

uniquevalsfromfield="summary_DESG_AREA "
0 Kudos
RhettZufelt
MVP Notable Contributor
Just because I was "editing" that in the forum reply box.  There is no space in my esearch.xml, just confirmed it.

R_

If I do put a space behind it, it looks like I only get "null".  Still spins the clock indefinatly though.
0 Kudos
StevenFoley
Occasional Contributor
Hello,

I am trying to get a URL field to work, and I am having difficulties.  I am new to flex, so I seem to be missing something here.  Below is my code.  I have a field named URL with a web address to tax assessment info.  I added the hyperlinkgridfield option and set to true, but It doesnt work in the map.


     <layer>
            <name>Parcel</name>
            <fields>
                <field name="URL"  alias="URL" hyperlinkgridfield="true"/>
            </fields>
            <links>
                <link includeinresults="true" field="" alias="" tooltip="">
                    <linkprefix/>
                    <linksuffix/>
                    <iconfield/>
                    <iconprefix/>
                    <iconsuffix/>
                </link>
            </links>
            <zoomscale>15000</zoomscale>
            <forcescale>true</forcescale>
        </layer>

Can anyone see what I am doing wrong here?  Thanks in advance for any advice.

Steve
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Steve,

   You have a couple of thing wrong here (all covered by the documentation):

This is an example of what a layer configuration should look like:

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>false</enableexport>
            <enableprintgrid>true</enableprintgrid>
            <name>Traffic Cameras</name>
            <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer/2</url>
            <expressions>
                <expression alias="Traffic Camera Description" textsearchlabel="Search Traffic Cameras by Location...">
                    <values>
                        <value prompt="Example: I-71" userlist="I-71,I-64">upper(DESCRIPTION) LIKE upper('[value]%')</value>
                    </values>
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Traffic Cameras</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>DESCRIPTION</titlefield>
            <fields all="false">
                <field name="DESCRIPTION" alias="Description" gridfield="true" />
                <field name="URL" alias="Show Image" hyperlinkgridfield="true"
                    hyperlinkaliastext="Get Traffic Image" visible="false" />
                <field name="ONLINE" alias="Online" gridfield="true"
                    gridfieldonly="false" />
                <field name="LAST_UPDATED" alias="Last Updated" gridfield="true"
                    gridfieldonly="false" dateformat="MM/DD/YYYY" useutc="true" />
            </fields>
            <links>
                <link alias="View Traffic Photo" diablelinksifnull="true">
                    <![CDATA[{URL}]]>
                    <icon><![CDATA[assets/images/i_camera.png]]></icon>
                </link>
            </links>
            <zoomscale>5000</zoomscale>
            <queryattachments>false</queryattachments>
        </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   Well that is what I get when I try to respond to threads when I am deep in some coding and not reading all of your post completely... I see the issue you told me about in your first post and the fix is a very simple one.

Make this change in the eSearchWidget.mxml popCBwithUnique function:

               
                var i:int = (cboLayerText.selectedIndex < 0) ? 0 : cboLayerText.selectedIndex;
                if (i == -1){
                    if(configSearchText[0].layer){
                        queryLayer = configSearchText[0].layer;
                    }else{
                        queryLayer = configSearchText[0].table;
                    }
                }else{
                    if(configSearchText.layer){
                        queryLayer = configSearchText.layer;
                    }else{
                        queryLayer = configSearchText.table;
                    }
                }
                
                if (queryLayer && !queryLayer.loaded){
                    queryLayer.addEventListener(LayerEvent.LOAD, queryLayer_loadHandler);
                    function queryLayer_loadHandler(event:LayerEvent):void
                    {
                        popCBwithUnique(targetField, sItemVal);
                    }
                    return;
                }
                
                this.cursorManager.setBusyCursor();


If you compare this to what you have the red line was at the very beginning and it need to be where I have it here.

I will roll out a fixed version soon for everyone else. Thanks for reporting.
0 Kudos
RhettZufelt
MVP Notable Contributor
That was it.  Thanks again for the widget and this "great" enchancement. (as well as the "fix" :o)

R_
0 Kudos
JohnLucotch
Regular Contributor
I'm struggling with the relate portion of the esearch widget.  Does it take one to many and many to one relationships?  Also, when I click on the related table in the Viewer the related table comes up but nothing is populated in the table.  Any ideas?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
John,

   So when you say
the related table comes up but nothing is populated in the table.
are you talking about the floating or fixed datagrid or are you talking about event before that and the "Choose Relate" window?
0 Kudos
JohnLucotch
Regular Contributor
I'm talking about the floating datagrid.  The relationships appear fine in ArcMap when I bring the map service into it.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
John,

   Do you have more than one relate for this layer? The fact that the relate is working in ArcMap does not mean that everything should be workin in ArcGIS Server. These are using two different methods of getting to the data, one SOAP and the other REST. Do you see the relate listed in your REST Service directory for that layer?
0 Kudos