Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

136291
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
NedCake
Deactivated User
Ned,

   The URL configuration documentation will still work for FV 2.3.1.


Robert,
The URL Search Configuration document calls for replacing the mapLoadComplete function (page 4 of 5). I've searched MapManager.mxml in my copy of the 2.3.1 viewer and cannot find a map load complete function. There is a map_loadHandler function but no mapLoadComplete.

Thanks
Ned
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ned,

   Download again. I have the correct documentation in the zip now.
0 Kudos
NathanEnge
Esri Contributor
Robert
A possible enhancement would be to enable multi feature spatial select, like holding down the ctrl key or the shift key to select features not adjacent to each other....?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nathan,

   Version 2.3.2.2 - 06/24/2011 of the eSearch Widget has your requested abilities without the shift or ctrl key.
0 Kudos
EricVenden
Frequent Contributor
Robert,
One quick question on the eSearch widget.  Is there a way to turn off the search after doing a graphical search? It appears that if you have been doing a graphical search at some point - even if you do a text search after a graphical search, and then clear the results and close the widget, the user can still draw graphics on the screen.

If this can be done in the code (or config.xml), just let me know where.
Thank you
Eric V
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Eric,

  Fixed in the now released Version 2.3.2.3. The graphical search tool will not deactivate when press any of the clear buttons on the widget.
0 Kudos
CharlesHarris
Emerging Contributor
Robert-

Can the "user lists" be used to specify an array of numeric values to be used as buffer distances for the buffer operation?  We would like to give the user a combobox of predefined values for the buffer operation but make it configurable in the xml so that we can have multiple configurations of the same eSearch widget in which some configurations allow for free form text input for the buffer radius while other configurations give a list of pre-defined values for buffer radii.

The userlists are not mentioned in the PDF, can you provide an example of the configuration of a user list if it can be used to tackle the problem above?

Thanks again for all of your hard work, you have inspired our team here to push the creative boundaries of widget design.  We have begun to incorporate field selection and filtering for the datagrid into your widget and have already incorportated a geographic search state within the widget that allows for a census geography search (i.e. search by state, city, zip, blockgroup) as well as an address search.

Jeremy
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Jeremy,

   No, the documentation does state that the userlist is for the expression element and
The userlist attributes give you the ability to predefine your own list of search values that will be presented
to the user in a dropdown instead of the user typing the value.

There is currently no ability to specify in the config the buffer amount.
0 Kudos
philippschnetzer
Frequent Contributor
Phillip,

   The datagrid is centered in the map by this line in the SearchWidget.mxml

PopUpManager.centerPopUp(myfloatdg);


I have not tried but I would guess that you would need to set the bottom and right of the myfloatdg to zero and comment out the above code.


Thanks, Robert, I appreciate your help!  Unfortunately I was unable to make this happen - I am not sure how to set the 'right' property - and having the 'bottom' set to 0, as below, makes the datagrid align to the top of the screen....
if(!myfloatdg){
      myfloatdg = SearchWidgetFloatDG(PopUpManager.createPopUp(map,SearchWidgetFloatDG,false,PopUpManagerChildList.POPUP));
      //commented out to move the datagrid...
      //PopUpManager.centerPopUp(myfloatdg);
      myfloatdg.bottom="0"; 


Not an expert with this stuff so your help goes a long way...thanks!  Some day we will meet in California - and I will buy you the finest double scotch available!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   This what I got to work for me (I think I ran into a Flex Viewer Bug with it's top attribute).

            private function showGridResults():void
            {
                try
                {
                    if(gridFields.length == 0){
                        showMessage("No Datagrid configured for this layer", false);
                        return;
                    }
                    
                    if(!myfloatdg){
                        myfloatdg = SearchWidgetFloatDG(PopUpManager.createPopUp(map,SearchWidgetFloatDG,false,PopUpManagerChildList.POPUP));
                        //PopUpManager.centerPopUp(myfloatdg);
                        myfloatdg.y = map.height + Number(ViewerContainer.getInstance().mapManager.top) - myfloatdg.height;
                        myfloatdg.x = 0;
                    }else{
                        var exists:Boolean = false;
                        for (var p:Number=0;p<systemManager.popUpChildren.numChildren;p++) {
                            if(systemManager.popUpChildren.getChildAt(p) is SearchWidgetFloatDG)
                            {
                                exists = true;
                                break;
                            }
                        }
                        if(exists == false)
                            PopUpManager.addPopUp(myfloatdg,map,false); 

                        //PopUpManager.centerPopUp(myfloatdg);

                        myfloatdg.y = map.height + Number(ViewerContainer.getInstance().mapManager.top) - myfloatdg.height;
                        myfloatdg.x = 0;
                    }
                    if(!gridFields)
                        gridFields = configSearchText[0].gridfields;
                    myfloatdg.enableExport = configSearchText[0].enableexport;
                    myfloatdg.layerDetails = queryLayer.layerDetails;
                    myfloatdg.csvSeperator = csvSep;
                    myfloatdg.csvExportOptionLbl = exp2csvOptLbl;
                    myfloatdg.txtExportOptionLbl = exp2txtOptLbl;
                    myfloatdg.ExportButtonLbl = expBtnLbl;
                    myfloatdg.csvName = _csvName;
                    myfloatdg.sumField = sumField;
                    myfloatdg.labelSum = lblSum;
                    myfloatdg.dgFieldAliases = fldAliases;
                    myfloatdg.dgColumns = gridFields;
                    myfloatdg.dgHyperColumns = gridHyperFields;
                    myfloatdg.dProvider = gridDataProvider;
                    myfloatdg.graphicslayer = graphicsLayer;
                    if(lState == "graphicalInput"){
                        var i2:Number = cboLayerGraphical.selectedIndex;
                        zoomScale = configSearchGraphical[i2].zoomscale;
                        myfloatdg.enableExport = configSearchGraphical[i2].enableexport;
                    }else if (lState == "textInput"){
                        var i:Number = cboLayerText.selectedIndex;
                        zoomScale = configSearchText.zoomscale;
                        myfloatdg.enableExport = configSearchText.enableexport;
                    }
                    myfloatdg.zoomScale = zoomScale;
                    myfloatdg.ownerWidget = this;
                }
                catch (error:Error)
                {
                    showMessage(error.message, false);
                }
            }
0 Kudos