Select to view content in your preferred language

Enhanced Search Widget for FlexViewer 2.1

158742
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
Heena,

   Using your configuration you provided and your map service in my Flex Viewer 2.5 and with my latest eSearch Widget version 2.5.0.5 it works fine:

[ATTACH=CONFIG]10740[/ATTACH]
0 Kudos
MLowry
by
Frequent Contributor
Robert,
I'd like to implement functionality in this widget so the user can input an address, and I will run a geoprocessing buffer on the address they input, and then create a report for their input address. Can you provide me any guidance for this?
Workflow as follows:
1. User inputs address
2. Geocode address and pass those X,Y coordinates to a buffer function.
3. Use the buffer to analyze what is in the buffer such as parcels that intersect the buffer and create a report showing all parcels intersecting the 100 foot buffer.

I see I can use your buffer widget as input to the eSearch for a graphical search, but I'd like to minimize the steps so the user just inputs and address, and it zooms to the predefined buffer distance and pops up with a report.



M Lowry,

   Currently there is nothing that it configurable to match your workflow.



Hi Robert, I have developed a widget which will take coordinate input or address input (using the LocateWidget template code) and it will buffer the point at a fixed distance, which will run a geoprocessing task that clips the data within the buffer, and then does a summary statistic to tell the count of how many point of a certain layer are in the buffer, displayed in a pop-up (similar to the population count GP example).

My question for you is if you have guidance for me on how to integrate my clipped results and somehow display them in a datagrid that you have configured for this Enhanced Search widget. I have studied for code-behind for this widget and it is very in-depth and a great workflow. I am interested in passing in my clipped result (stored "in_memory" in my geoprocessing tool) and displaying the data in a similar datagrid. Do you have any advice?

Thanks!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
M Lowry,

   Look at using the new SearchWidgetRelateFloatDG.mxml as it does not have all the ties back to eSrearch widget with mouse over events.

This is the code you need to concentrate on:

                            if(!relfloatdg){
                                relfloatdg = new SearchWidgetRelateFloatDG();
                                PopUpManager.addPopUp(relfloatdg,map,false,PopUpManagerChildList.POPUP);
                                PopUpManager.centerPopUp(relfloatdg);
                            }else{
                                var exists:Boolean = false;
                                for (var p:Number=0;p<systemManager.popUpChildren.numChildren;p++) {
                                    if(systemManager.popUpChildren.getChildAt(p) is SearchWidgetRelateFloatDG){
                                        exists = true;
                                        break;
                                    }
                                }
                                if(exists == false){
                                    PopUpManager.addPopUp(relfloatdg,map,false,PopUpManagerChildList.POPUP); 
                                    PopUpManager.centerPopUp(relfloatdg);
                                }
                            }
                            
                            if(relfloatdg.datagrid.dataProvider)
                                relfloatdg.datagrid.dataProvider.removeAll();
                            relfloatdg.csvExportOptionLbl = exp2csvOptLbl;
                            relfloatdg.txtExportOptionLbl = exp2txtOptLbl;
                            relfloatdg.ExportButtonLbl = expBtnLbl;
                            relfloatdg.csvSeperator = csvSep;
                            relfloatdg.dgFieldAliases = relfldAliases;
                            relfloatdg.csvName = relatescsvName;
                            relfloatdg.sumField = sumField;
                            relfloatdg.labelSum = lblSum;
                            relfloatdg.dgColumns = relateFields;
                            relfloatdg.dgHyperColumns = relateHyperFields;
                            relfloatdg.layerDetails = relqueryLayer.layerDetails;
                            relfloatdg.dProvider = fset.attributes;
                            relfloatdg.enableExport = relExportEnabled;
                            relfloatdg.dgtitle = relLbl;


This shows all the vars that have to be passed to the SearchWidgetRelateFloatDG. I have seen where others have reused my floatDataGrid so it can be done. I can't say I have time to walk you through each step required but you should be able to figure it out by walking the code.
0 Kudos
MLowry
by
Frequent Contributor
M Lowry,

   Look at using the new SearchWidgetRelateFloatDG.mxml as it does not have all the ties back to eSrearch widget with mouse over events.

This is the code you need to concentrate on:

                            if(!relfloatdg){
                                relfloatdg = new SearchWidgetRelateFloatDG();
                                PopUpManager.addPopUp(relfloatdg,map,false,PopUpManagerChildList.POPUP);
                                PopUpManager.centerPopUp(relfloatdg);
                            }else{
                                var exists:Boolean = false;
                                for (var p:Number=0;p<systemManager.popUpChildren.numChildren;p++) {
                                    if(systemManager.popUpChildren.getChildAt(p) is SearchWidgetRelateFloatDG){
                                        exists = true;
                                        break;
                                    }
                                }
                                if(exists == false){
                                    PopUpManager.addPopUp(relfloatdg,map,false,PopUpManagerChildList.POPUP); 
                                    PopUpManager.centerPopUp(relfloatdg);
                                }
                            }
                            
                            if(relfloatdg.datagrid.dataProvider)
                                relfloatdg.datagrid.dataProvider.removeAll();
                            relfloatdg.csvExportOptionLbl = exp2csvOptLbl;
                            relfloatdg.txtExportOptionLbl = exp2txtOptLbl;
                            relfloatdg.ExportButtonLbl = expBtnLbl;
                            relfloatdg.csvSeperator = csvSep;
                            relfloatdg.dgFieldAliases = relfldAliases;
                            relfloatdg.csvName = relatescsvName;
                            relfloatdg.sumField = sumField;
                            relfloatdg.labelSum = lblSum;
                            relfloatdg.dgColumns = relateFields;
                            relfloatdg.dgHyperColumns = relateHyperFields;
                            relfloatdg.layerDetails = relqueryLayer.layerDetails;
                            relfloatdg.dProvider = fset.attributes;
                            relfloatdg.enableExport = relExportEnabled;
                            relfloatdg.dgtitle = relLbl;


This shows all the vars that have to be passed to the SearchWidgetRelateFloatDG. I have seen where others have reused my floatDataGrid so it can be done. I can't say I have time to walk you through each step required but you should be able to figure it out by walking the code.

Awesome, thanks Robert.
0 Kudos
HeenaLee
Regular Contributor
Heena,

   Using your configuration you provided and your map service in my Flex Viewer 2.5 and with my latest eSearch Widget version 2.5.0.5 it works fine:

[ATTACH=CONFIG]10740[/ATTACH]


Thank you Robert! It sure did work! Happy Holidays!

Heena
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
All,

   A new Version is available:

Version 2.5.0.7 - 12/27/2011
* Fixed issue with datagrids when compiled using the Adobe 4.5.1 SDK
* Added Multiple Link Support.


PAY ATTENTION TO CHANGES TO SEARCHWIDGET.XML
0 Kudos
AlexSanders
Frequent Contributor
I'm having troubles with the linkfield in the Version 2.4.0.14 of the search viewer. I'm using the linkprefix to parse the link field to a coldfusion page. When I use the field that I want linked it brings over a different number and adds a negative sign to it. for example.

http://gisweb/cfGIS/basefile.cfm?SdeNum=-54420094

It should be

http://gisweb/cfGIS/basefile.cfm?SdeNum=482450818

The field is an integer. Any suggestions?

Alex
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alex,

   Never seen that issue before... Care to share your SearchWidget.xml
0 Kudos
AlexSanders
Frequent Contributor
Robert,

I just figured it out I think.  I was going over several of your past post's and saw where you added the tag <useamf>false</useamf> to the top line of the layer in the xml.  I added that and it seems to be working. 

I was having the same issue with the out of the box search widget.  I tried implementing your linkprefix and linksuffix functionality to the widget and was getting the same issue. 

What does the <useamf> tag do?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Alex,

  amf stands for ActionScript Message Format which was something introduced in ArcGIS Server 10 to provide faster response results from queries to the map service.
0 Kudos