Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

158498
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
Will,

You have some issues in your code:

SearchWidget.mxml (code piece)
if (configSearchText.useproxy && configData.proxyUrl)
{
queryTask.proxyURL = configData.proxyUrl;
}
var query:Query = new Query();
var myPattern:RegExp = /\[value\]/g;
var myPattern2:RegExp = /\[value2\]/g; //added by W.Hughes - variable for installation code
var expr:String;
var exprFinal:String = expr; //added by W.Hughes to add second variable to expression
//You set this here to equal expr, but expr has not been edited by the replace functions yet.
if (txtSearch.visible){
expr = queryExpr.replace(myPattern, txtSearch.text);
expr = expr.replace(myPattern2, cbo2.text); //variable for installation code
}else{
expr = queryExpr.replace(myPattern, cbSearch.selectedItem.value);
}
//query.where = expr; this is the original code
query.where = exprFinal //added by W.Hughes
0 Kudos
MicahVan_Maanen
Emerging Contributor
Robert,
Thank you for the excellent widget.

I do have one question, is it possible to change the Search List Combo box to Radio Buttons?  I noticed this on the Parcel Search box on your site and it looks very nice.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Micah,

   If you are willing to modify the source code than yes. When I make changes to widgets I have to think about the thousands of people that have downloaded this widget and if I can make a change work for every one. changing from a combobox to a radio button group will only work in limited situations because of limited widget real estate, It would not look good at all to have 6 radio buttons but 6 items in a combobox is OK.
0 Kudos
MicahVan_Maanen
Emerging Contributor
Robert,
Thanks for the reply, that makes perfect sense.

I'll work on modifying the source code.
0 Kudos
Sung-JunKim
Emerging Contributor
Robert and All,
This is a great tool and I am using it nicely.  I would like to see if there is a way to add AND or OR clause to the existing query. What I like to do is that I would like to search based on multiple columns or a range within a column without adding another combo box. For example,
Example 1: ColumnA = '[value]' AND ColumnB = '[value]'
Example 2: ColumA >'[value]' AND ColumnA <'[value]'

Thanks,
Sung-Jun
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
0 Kudos
MarcWeinshenker1
Regular Contributor
Hi Robert,

I'm making great headway configuring the eSearch widget for a very specific application.  Many thanks for the functionality and flexibility.

I did notice a little quirk, though, and didn't see anything mentioned in this thread as I looked back over a few pages.  If I do this:

1) graphically select a parcel
2) buffer on the selected parcel
3) select parcels with the buffer

Then when I minimize the eSearch widget window (only minimize, not close) the selection disappears while the buffer remains in the display.  When I restore the widget window to full size the selection comes back.  Don't know if this is a bug or a feature, but I think it would be better if nothing disappeared from the display when the widget is minimized, but only when it is closed.

Thanks,
Marc
0 Kudos
MattShetzer
Deactivated User
Robert,
I'm hoping you might be able to help me on this.  I'm using your excellent eSearch 2.2.9 widget.  I've got many searches working, but this one is giving me a

"[RPC fault faultstring="Unable to complete operation." faultcode="400" faultdetail="unable to complete Query operation."]" error.

I've got to be missing something.... I'm stuck !!!!

<layers>
  <layer>
            <name>Well</name>
            <enableexport>true</enableexport>
            <url>http://server.petro-fs.com:8887/ArcGIS/rest/services/OrrEnergy/OrrEnergy/MapServer/12</url>
            <expressions>
     <expression alias="Well Name" textsearchlabel="Search by Well Name (Wildcards) [Example: Lakes]">upper(F_Name) LIKE upper('[value]%')</expression>
     <expression alias="API" textsearchlabel="Search by API [Example: 05-123-25689 ]">upper(API) = upper('[value]')</expression>
   </expressions>
   <graphicalsearchlabel>Use one of the graphical search tools to select Well</graphicalsearchlabel>
            <spatialsearchlabel>Select the two layers for spatial query</spatialsearchlabel>
   <spatialsearchlayer>true</spatialsearchlayer>
   <spatialrelationlayer>true</spatialrelationlayer>
   <titlefield>F_Name</titlefield>
            <linkfield linkprefix="">PhotoQuad</linkfield>
            <icon isfield="true" iconprefix="" iconsuffix=""></icon>
            <fields all="false">
                <field name="F_Name" alias="Well" gridfield="true"/>
                <field name="F_Status" alias="Status" gridfield="true"/>
                <field name="API" alias="API" gridfield="true"/>
                <field name="PhotoQuad" hyperlinkgridfield="true" hyperlinkaliastext="Photo Lookup"/>
            </fields>
               <zoomscale>100000</zoomscale>
        </layer>


Thanks again for all your support and excellent tools !!!
Matt Shetzer
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Matt,

    Your mapservice must be coming from something other than SDE so you have to change your SQL statement.

F_Name LIKE  '[value]*'
0 Kudos
CoryHines
Deactivated User
Just curious if anyone else has gotten the same errors that I have when adding the new URL search configuration info.

-1120: Access of undefined property BaseWidget. > error from WidgetManager.mxml
-1120: Access of undefined property _configData. > error from ViewerContainer.mxml

Changed a few things on the lines that each of these is coming up, and added some other statements, but haven't been able to completely get rid of these.

Cory
0 Kudos