Enhanced Search Widget Version 2.21.1 - 11/16/21

07-14-2014 03:57 PM
Labels (1)

Enhanced Search Widget Version 2.21.1 - 11/16/21

Live Preview Site

Web AppBuilder for ArcGIS | Help - Enhanced Search widget


List of the latest enhancements and changes:

  1. Added Max rows of 10 to all the widgets dropdowns.


Older enhancements or changes

Check the "Older enhancements or changes.txt" in the download for a complete list.


Older Versions

Last 2.17 version

Last 2.13 version

Last 2.12 version

Last 2.11 version

Last 2.9 version

Last 2.7 version

Last 2.6 version

Last 2.5 version

Labels (1)


I am also interested in the multi select options, if you have any progress in this option please share it, I will be really appreciate your favor.   

Irfan Afsar


I am using your widget which is really good! I am trying to find the way when the Search will apply in esearch widget all other layers will be turn off by self, only data from esearch layer will be display on map. Right now I have layer toggle button which is doing this job manually.  Thanks again !


Irfan Afsar


   If you have code already for your toggle button then just add that code to the eSearch widgets _onSearchFinish method.

Thanks Robert for your quick reply! Actually, I forgot to mention , that is your toggle widget button which I am using manually. I don't have the exact code it is a whole widget (Layer Toggle Button).  I am sorry new to be in programming world not having experience, I am trying to learn day by day. I need your help in this matter please.


   You should start a new thread about this, as it does have something to do with the eSearch, but is really a unique customization question.

Thanks Robert, I will!

Hi Robert,

Possible bug or just user-error but I'm seeing strange results with the "Export to GeoJSON" functionality of search results.  In this attached image is a selection result (red polygons), which were then exported to GeoJSON to local disk.  Using the AddData widget and choosing the GeoJSON export file -- the result of that is the single blue polygon.

If I validate the contents of the exported GeoJSON file on geojsonlint.com it's showing that it is invalid:

However, the GeoJSON does validate in https://codebeautify.org/jsonviewer


   Interesting. The Export to GeoJSON is not my code it is actually part of WABs source code.

So is the AddData widget.  huh.

Either that or the GeoJSON export portion of WAB.

I just created a new hosted wab app using the AGOL Web AppBuilder and included the Select and AddData widgets.

1.  Select contiguous polygon features and export as GeoJSON (using the Select widget).

2.  Using AddData widget, on the File tab I drop in the result.geojson file.

It did not import or export correctly, unsure which one.  This is the result (darker blue is the geojson export result) on top of the original selected polygon features (white outline, light blue fill).

Great with that you can contact esri tech support and report the bug.

Hi Robert,

I’m using your enhanced search widget in WAB Developer version 2.5. I have Address Point layer that is joined with an assessor table.  Both are in separate SDE databases.  When I try and create a search on ownership of the joined address point using unique values.  It takes about 10 minutes to populate.  (Side note: I’m using the same layer but for Parcel ID searchable by unique values and populating only take seconds.)  Do you have any thoughts on how to speed up the process?  I don’t think my users will want to wait this long for a search. 



   This is more of a server service optimization question. I would add an index to the field you are using in your sde database.

Hi Robert I appear to be having the same issue with the related table fields that Jayson was having. I'm running WAB 2.5 and eSearch 2.5. Could you possibly help me out?


   So you are using WAB Developer 2.5? I have yet to see the issue Jayson and you are mentioning.

Hello Robert, is there an option to select from current results?  I only see the following results options.


Search Result Options

No there is no option to select from current selection. I have look into this before and it is way to much effort.

Robert. Is there a way to make this widget to auto zoom to the applied buffer, I did a couple of searches but couldn't find an answered, btw do you know if there is a way to search only on a thread and not on all places?  Daniel


  Sure just update this function in the Widget.js (lines 20 -23):

      _bufferGeometries: function (geomArr, sr, dist, unit, isGraphicalBufferOp) {
        if (geomArr) {
          var bufferParameters = new BufferParameters();
          var resultEvent;
          bufferParameters.geometries = geomArr;
          bufferParameters.bufferSpatialReference = sr;
          bufferParameters.unit = GeometryService[unit];
          bufferParameters.distances = dist;
          bufferParameters.unionResults = true;
          bufferParameters.geodesic = true;
          bufferParameters.outSpatialReference = this.map.spatialReference;
          esriConfig.defaults.geometryService.buffer(bufferParameters, lang.hitch(this, function (evt) {
            resultEvent = evt[0];
            var graphic = new Graphic();
            graphic.geometry = resultEvent;
            graphic.symbol = new SimpleFillSymbol(this.config.bufferDefaults.simplefillsymbol);

            var gExt = graphicsUtils.graphicsExtent(this.graphicsLayerBuffer.graphics);
            if (gExt) {
              this.map.setExtent(gExt.expand(.9), true);
            html.setStyle(this.btnClearBuffer2, 'display', 'block');
            html.setStyle(this.btnClearBuffer3, 'display', 'block');
            if (isGraphicalBufferOp) {
              this.search(resultEvent, this.graphicLayerIndex);

As far as searching a certain thread, I don't know.

Really nice! I'm surprise nobody asked before. Thank you.


   Auto zoom to buffer will be a configurable option in the next release. 

Hi Robert - I think I may have found an issue with the change # 5 for this particular use case:  In my search layer, we have a string field (Amenities) that contains comma separated values of various length constructed like:

Bait Shop, Restrooms, Swimming, Picnic Tables

Baseball Fields, Fishing, Hiking, Picnic Tables,

etc, etc per row

For my search construction, I am using a contains operator and am supplying a predefined list of values.  This search is now failing at 2.6 where at 2.5 no issues.  

When selecting a predefined value from the dropdown at 2.5, the console log shows:

SQL Where with layers definition expression:  Amenities LIKE '%Bait%' AND Amenities LIKE '%Shop%'

This search returns with no issues.

When selecting a predefined value from the dropdown at 2.6, the console log shows:

SQL Where with layers definition expression:  Amenities LIKE '%Bait%' OR Amenities LIKE '%Shop%'

This search fails.

Not sure if you can see the error in the console log. If you have any ideas that would be great.




   Go get version to have that issue fixed.

Gotcha, thanks

Hi Robert,

Love this  tool! Is there a way within the parameters to search multiple layers at once? I have 7 layers that I need to search and am wondering if it's possible to do selections on multiple layers so I don't have to repeat the search process over and over. Thank you again for creating this app, it's awesome.

Andrew N


  No that is not an option as this widgets works off the JS API's QueryTask which is limited to searching on layer at a time.

Yes WAB Developer 2.5. The issue I'm refering to is the esearch config is seeing the realted table, but the fields to include are the same fields as the feature class instead of the fields from the realted table. I might be doing something wrong if we are the only ones having this issue.


Hi Robert,

I have few questions related to Enhanced Search Widget Version In my app my client want to search from Last Days option. For that purpose I have tried this in esearch widget but some how  it don't update the current date(Last 30 Days) should be  from current date - 30 days. But it does not update by self. Although 1 year(365 days) is always have current date (today date). Also,Is it possible to change the date format  instead of (year, month, day) to (month, day,year)? 

Last Days

How to change the widget window opening size? I want it like that?

Current Window SizeWindowResize

I really appreciate your help.


   Strange I will have to look into this as I have yet to see this.


  I do not count today as a day since it is not over yet. If you are not happy with that then you would have to modify the widget code for that (in the SingleParameter.js line 966). If you want to change the date display format you need to edit the SingleParameter.html file date input controls (datePattern):

<input data-dojo-attach-point="dateTextBox" data-dojo-type="dijit/form/DateTextBox"
                     data-dojo-props="value:new Date(),trim:true,constraints:{datePattern: 'yyyy-MM-dd'}"
                     class="dijit-form-DateTextBox" style="display:none;width:100%;height:30px;" />

If you want to make the widget wider then you need to add a width property to the eSearch widget in the main config.json

Sorry if I asking this again since there 84 pages of changes in this thread now.

Is there a way to set the autozoom to selected feature on the Results tab to be a bit more zoomed out? I know I can force scale, but I have parcels of various sizes so I don't want that. I just want a bit more zoomed out for the print widget to catch the adjoining properties. For all size parcels.

James there is no setting change for this. You will have to edit the extent.expand portion of the zoomAll function.

Hi Robert,



Thanks a million for updating your eSearch Widget to version so promptly.


I made a test Parcel Map with Web AppBuilder version 2.6 (October 2017) using your Custom Widgets:


Enhanced Search Widget, Version 74                       11/17/2017


Enhanced Basemap Gallery Widget 2.5, Version 14            8/10/2017


Identify Widget, Version 28                                      8/16/2017


Elevation Profile Widget 2.5, Version 16                             8/10/2017


Map Progress Indicator Widget 2.5, Version 9                     8/10/2017


Enhanced Bookmark Widget 2.5, Version 7                         8/17/2017


Enhanced Locate Widget 2.5, Version 13                             8/10/2017


Popup Panel Widget 2.6, Version 15                                     11/17/2017







Everything seems to be working fine in WAB 2.6.


However, I found an odd behavior with eSearch



When you search by Shape by engaging the Select by Point Tool, everything works as expected.




When you click on the Result, the full list of Attributes show up in the Popup Panel.



This is good.


Refresh the app.


Open the By Shape Tab.


Check the option to Buffer Graphic by 300 feet.



Engage the Select by Point Tool



Add a Point




At this stage, it should draw a circle of radius 300ft centered around this point, and proceed to select all the parcels that intersect this circle.



However, nothing happens.





Refresh the app.


Next, I tried to use the Enable multi-part graphics option.



I used the Select by Point tool.

I could enter the 1st point.


However, I could not enter the 2nd point.





Now, this behavior is sporadic.


Sometimes I could enter 3 points in a row and then the 4th point will not be accepted like this:





The Zipped App is under:





Thanks again for continuing to support all your Custom Widgets with every new release of the Web AppBuilder.


Hope to see you at the Dev Summit in March!



Best regards,





   That is strange. I am not seeing that on my live preview site. What is the console reporting?

Hi Robert,



I am running the tests using Google Chrome latest version and here is what the Console shows.








Press F12 to open Chrome Dev Tools

Open the Console Tab




There is one error during the initial loading about not being able to access an avenir-next font.


However, this should not affect the application.


Clear the Console




Open the By Shape Tab on the Enhanced Search Widget


Check the Buffer Graphic Option



Engage the Select by Point Tool.

Add a Point



Add a point

The point does not appear on the map!

The Console windows shows no activity.

No errors.


Now, try using the Select by Extent Tool.





Draw a rectangle.


A 300ft buffer is drawn around the rectangle.

31 polygons are found that intersect this buffer.





This works!


So, Selection by Extent works when the buffer option is checked.


The console shows no errors.




So it seems that the Selection by Point is failing when the buffer option is checked.




Best regards,





  So the issue is buffering using your geometry service (intermittently).

Sometimes I get this error when looking at the network traffic:

{"error":{"code":500,"message":"Error executing buffer","details":[]}}

And other times I get proper results.

Here is the url string I was testing:
Which is a sample point buffered by 300 Feet.

Hi Robert,



Yes, you are absolutely correct!


Thanks for your time in investigation this and finding the culprit.

We have to fix our own Geometry Service at Maricopa County. It is behaving erratically.


There is nothing wrong with your Enhanced Search Widget. All the functions with eSearch have worked flawlessly in the past. I am confident it will work perfectly once we get the problem with our Geometry Service resolved.


Sorry for taking up your time. This was a problem at our end.


Thanks also for showing me the trick on how to directly test our Geometry Service running a 300ft buffer on the Parcel Map Service.


I learned something very useful!


Best regards,




   The next version will make the zoom extent factor configurable.


   The next version will make the display date configurable.

Is it possible to maintain results after the eSearch widget has been destroyed? I would like to be able to re-add the results back to the map and the results tab. 

I have a different widget that must reload my application completely. This destroys the eSearch widget which removes the results.

Does this sound remotely possible? I am able to capture the "results" object at the _drawResults function, but I'm not sure where/how to pass that back into the application. Any help would be appreciated.


   It should be possible with some coding. The route I would take is using the URL search then. Since your other widget has to reload the site that means using a url search would be practical. You can get the value to use for the url search from the "Export search url" in the action menu. This route will just re-execute the search but is by far the simpler route.

Hi Robert,



You were correct. The issue was our Geometry Service. We are using one that works.

Everything is working fine now with your Enhanced Search Widget version and WAB 2.6.





I can buffer a point with a buffer distance of 300ft and find all Parcels that intersect this buffer.





I can enable multi-part graphics and drop more than 1 point and find all the parcels within 300ft of these two points.







Thanks again for all your help in tracking down the problem.

We are all good now.


Best regards,



Thanks for the quick reply Robert.

That was my initial thought too, to use the url search. This did work for me. I created a list of the parcel numbers that were searched through the attribute search. I created a URL using those parcel numbers. This then opened my application with the correct Parcels highlighted and listed in the results.

My hope, was that I could just capture the "results" object and pass that back into the eSearch some where and have those results re-applied to the application. I thought that would be a less labor intensive approach, but it has proven quite difficult so far. If you have any suggestions for passing the results object, I'm all ears. 


  No trying to just persist the results would be the more labor intensive route

I am not sure if I should create a new thread for this question, but here it goes. I have an embedded WAB Application using the esearch in aspx and would like to perform an http redirect after a search or mouse click within the map using a value in the results pane to reload the aspx page.


   Yes as this is a very specific customization question a new thread is needed.

Hi Robert,



I ran into a snag while trying to use your Enhanced Search Widget on the Launchpad Theme of the Web AppBuilder 2.6.


Here are the steps to reproduce the problem.


Launch Chrome

Launch Web AppBuilder 2.6.1

Theme | Launchpad Theme




Add Widget in placeholder #1



Add eSearch



Configure Enhanced Search.

Press OK




Open Enhanced Search




You get an error message:


Create widget error:





The Console Tab in Chrome DevTools shows this listing:





Here is the demo app using the Launchpad Theme.

You get the error message when you open the Enhanced Search Widget.








This issue is peculiar to the Launchpad Theme.

There are no issues with the Foldable Theme, Dart Theme, Tab Theme or Jewelry Box Theme.


Best regards,




  OK, Here is the fix for the Launchpad Theme:

      _addCustomStyle: function(theme) {
        var customStyles = lang.getObject('customStyles', false, theme);
        if(!customStyles || customStyles.mainBackgroundColor === ""){
        var rgbArray = Color.fromHex(customStyles.mainBackgroundColor).toRgb();
        var cssText = ".FoldableTheme.yellow .jimu-draw-box .draw-item.jimu-state-active,";
        cssText += ".TabTheme.yellow .jimu-draw-box .draw-item.jimu-state-active,";
        cssText += ".FoldableTheme.yellow .search-btn,";
        cssText += ".TabTheme.yellow .search-btn,";
        cssText += ".JewelryBoxTheme.yellow .search-btn,";
        cssText += ".LaunchpadTheme.style3 .search-btn,";
        cssText += ".JewelryBoxTheme.yellow .jimu-draw-box .draw-item.jimu-state-active {";
        cssText += "background-color: rgb(" + rgbArray.join(",") + ");";
        cssText += "background-color: rgba(" + rgbArray.join(",") + ", 1);";
        cssText += "}";
        cssText += ".FoldableTheme.yellow .search-btn:hover,";
        cssText += ".TabTheme.yellow .search-btn:hover,";
        cssText += ".JewelryBoxTheme.yellow .search-btn:hover,";
        cssText += ".LaunchpadTheme.style3 .search-btn:hover,";
        cssText += ".FoldableTheme.yellow .jimu-draw-box .draw-item:hover,";
        cssText += ".TabTheme.yellow .jimu-draw-box .draw-item:hover,";
        cssText += ".JewelryBoxTheme.yellow .jimu-draw-box .draw-item:hover {";
        cssText += "background-color: rgb(" + rgbArray.join(",") + ");";
        cssText += "-ms-filter: 'Alpha(opacity=70)';"
        cssText += "background-color: rgba(" + rgbArray.join(",") + ", 0.7);";
        cssText += "}";

        var style = html.create('style', {
          type: 'text/css'
        try {
        } catch(err) {
          style.styleSheet.cssText = cssText;
        style.setAttribute('source', 'custom');


Hi Robert,


Yes, that fixed the issue!

I replaced the code in eSearch\Widgets.js with your revised version.

Everything is working now with the Launchpad Theme.

Thanks for your lightning fast response and resolution.


Version history
Revision #:
7 of 7
Last update:
‎11-16-2021 06:12 AM
Updated by: