Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

140799
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
GaryJohnson2
Deactivated User
Thanks Robert,

I am using version: Version 2.5.1.2 - 1/12/2012

I guess I do not understand where I list the link fields in the SearchWidget.xml

Gary
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Gary,

   Hmm... Not sure how you are missing that in the documentation... Or the example SearchWidget.xml in the zip?

        <layer>
            <definitionexpression></definitionexpression>
            <enableexport>true</enableexport>
            <name>Louisville Zoning</name>
            <url>http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_LandRecords_Louisville/MapServer/2</url>
            <expressions>
                <expression alias="Zoning Code" textsearchlabel="Search Zoning Code [ Example: OR1 ]:"
                    userlist="OR1,C2,OTF">upper(ZONING_CODE) = upper('[value]')</expression>
                <expression alias="Zoning Type"
                    textsearchlabel="Search Zoning Type [ Example: RESIDENTIAL ]:">upper(ZONING_TYPE) = upper('[value]')</expression>
                <expression alias="Zoning Name"
                    textsearchlabel="Search Zoning Name [ Example: RES MULTI-FAMILY ]:">upper(ZONING_NAME) LIKE upper('%[value]%')
                </expression>
            </expressions>
            <graphicalsearchlabel>Use one of the graphical search tools to select Zoning</graphicalsearchlabel>
            <spatialsearchlayer>true</spatialsearchlayer>
            <titlefield>ZONING_NAME</titlefield>
            <fields all="true" />
            <links>
                <link includeinresults="false" field="" alias="">
                    <linkprefix></linkprefix>
                    <linksuffix></linksuffix>
                    <iconfield></iconfield>
                    <iconprefix></iconprefix>
                    <iconsuffix></iconsuffix>
                </link>
            </links>

            <zoomscale usegeometry="true">10000</zoomscale>
        </layer>


For multiple links you just add another link element and it's children to the links parent element.

I spend a fair amount of time on my documentation so that is why I usually do not restate what I have already written in the documentation on these forums.
0 Kudos
GaryJohnson2
Deactivated User
Robert,

I thought that was where I add additional links, but they are not active. I see the link path, but they are not active. I will try more before I ask more questions.
Thanks for your help.
Gary
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Gary,

   Also post the bit of the SearchWidget.xml for the particular layer that you have having issues with  from <layer> to </layer> so I can see if you having just some syntax or something wrong.
0 Kudos
GaryJohnson2
Deactivated User
I may have way to much in this post, so forgive me.

  <layer>
   <definitionexpression></definitionexpression>

   <enableexport>true</enableexport>

            <name>Site Description Links</name>
            <url>http://gisweb.unr.edu/ArcGIS/rest/services/Geothermal/Geothermal_Clusters/MapServer/0</url>

            <expressions>

             <expression alias="Name"
                textsearchlabel="Search Name [ Example: Abel Spring ]:"
userlist="
Alkali Hot Spring,
Amargosa Desert"

>Name = '[value]'</expression>

            </expressions>


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

   <spatialsearchlayer>true</spatialsearchlayer>

   <titlefield>Name</titlefield>

            <fields all="false">

<field name="Name"/>
<field name="SiteLink" alias="Site Description"/>
<field name="PhotoLink" alias="Photo Web Link"/>

            </fields>


<links>
<link includeinresults="true" field="SiteLink" alias="">
<linkprefix></linkprefix>
<linksuffix></linksuffix>
<iconfield></iconfield>
<iconprefix></iconprefix>
<iconsuffix></iconsuffix>
</link>

<link includeinresults="false" field="PhotoLink" alias="">
<linkprefix></linkprefix>
<linksuffix></linksuffix>
<iconfield></iconfield>
<iconprefix></iconprefix>
<iconsuffix></iconsuffix>
</link>
</links>

I appreciate your help in looking at this.
Gary
0 Kudos
GaryJohnson2
Deactivated User
The web application is:

http://gisweb.unr.edu/flexviewers/geothermal_25/

to see the results.

gary
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Gary,

   Wow that took some serious cleaning up but here is your whole SearchWidget_Links.xml


Next time please start a new thread so I can get some points for answering your questions.
0 Kudos
GaryJohnson2
Deactivated User
Robert,

Thank you so much. I appreciate your help, and did not expect all that you did. You'r good!

Gary J.
0 Kudos
ErikMartin
Frequent Contributor
Robert,

First, let me add my voice to the chorus of thanks-- your tools and support of the community are outstanding.

I have the Enhanced Search Widget up and running successfully with my MapService.  I also have a geoprocessing service that returns a point layer as part of my map.  I would like the user to be able to select these results and view the table in the DataGrid.  I am fairly new to both ArcGIS Server and Flex (I have poked around the uncompiled code, but haven't gotten into it yet).  It's not clear to me whether geoprocessing results which come from the UniqueJobID/%scratchworkspace% on the server have a REST endpoint.  And if so, if there is a consistent one that can be access across  sessions with the same URL. 

I hope this hasn't been address before-- I searched for it, but this thread is so long, I may have missed it. 

Again, many thanks for your help & efforts!
-Erik
0 Kudos
MLowry
by
Frequent Contributor
nevermind still trying to fix the vertical scrollbar in the resultslist state.
0 Kudos