Enhanced Search Widget Version 2.23.1 - 11/22/22

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

Enhanced Search Widget Version 2.23.1 - 11/22/22

Live Preview Site

Web AppBuilder for ArcGIS | Help - Enhanced Search widget

 

List of the latest enhancements and changes:

  1. Fixed issue with Spatial Relationship settings

Older enhancements or changes

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

 

Older Versions

Last 2.21 version

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)
Attachments
Comments

Using WAB2.3 I'm trying to use and to configure the latest version of esearch-widget available as of today (2.4.0.2).

However, I get the spinning wheel of death when trying to use the esearch widget within my app.

Using web development tools I get an error 404 on following line:

http://servername:3344/webappbuilder/apps/12/jimu.js/dijit/FeatureActionPopupMenu.js?wab_dv=2.3 

Could this be related to a version mismatch between esearch widget and my current version of WAB ?

Thanks for helping out and your effort on making this widget !

CC Weedcontrol,

   If the geometry is other than a point and you do not have a zoom scale specified then the result geometry will be used and zoomed to (1.5 meaning the result geometry envelope plus 50%). To change this to zoom out further then change this line:

this.map.setExtent(gExt.expand(1.5), true) (2.0 would be twice the size of the geometry).

Todd,

   You have the ability to change the buffers color in the Widgets settings page. As far as advice on creating your own widget You are doing what my advice would be (look at existing widgets to borrow code from).

Nadia,

   Unfortunately the Attribute table widget is an esri OTB widget and I have no control over it's display.

Steven,

  Yes this would be a version mismatch issue.

Ok, thanks Robert.

Is there a way to get hold of a(n) (older) version of the widget (WAB2.3 compatable) ? 

rscheitlin

Hi Robert,

Thanks for your quick response! I was wondering when you change field format in eSearch widget (please see screenshot below) Where should these changes be reflected, in  a popup or in the results tab and a corresponding attribute table?  In my case whatever I do to change field order and digit precision in the edit field window of the eSearch widget, does not get reflected anywhere. So my trails have 10 digit precision ...

Any advice? I am new to the WAB and really appreciate any advice you could provide.. Thank you!

Nadia

Nadia,

  Those changes will be reflected in the eSearch Widgets popup and the eSearch widgets results window.

Steven,

   Here is the last 2.3 version http://gis.calhouncounty.org/WAB/V2.3/widgets/eSearch/eSearch.zip 

Excellent ! Thanks Robert !

I got it to work, i restarted my PC.

Robert the features are polygons and i made changes to both lines in the eSearch\Widget.js but it's still zooms in exactly the same extent.

I am making changes to the \WebAppBuilderForArcGIS\server\apps\8\widgets\eSearch\Widget.js

var gExt = graphicsUtils.graphicsExtent(this.currentLayerAdded.graphics);
          if (gExt) {
            this.map.setExtent(gExt.expand(2), true);
          } else {
            var mp2 = this.currentLayerAdded.graphics[0].geometry;
            this.map.setScale(zoomScale);
            this.map.centerAt(mp2);

var gExt = graphicsUtils.graphicsExtent([item.graphic]);
          if (gExt && !layerConfig.forceZoomScale) {
            this.map.setExtent(gExt.expand(2), true).then(lang.hitch(this, function () {
              if ((this.map.infoWindow && this.config.enablePopupsOnResultClick) && !lyrHasPopupDisabled) {
                this.map.infoWindow.setFeatures([item.graphic]);
                if (this.map.infoWindow.reposition) {
                  this.map.infoWindow.reposition();
                }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

CC Weedcontrol,

   Strange that change works for me. Are you sure it is not working can you try 3.0?

Greetings Robert,

Outstanding widget! I just downloaded the widget and it works nicely. I do however need some advice on an issue that we have come across and I’m hoping that esearch widget can be the solution. Our Department has a Cadastral/Parcel layer with multiple Ownername fields (see below attachment) and I would like for the widget to search all ownername fields (Ownername1 – Ownername 20) to return all names that meet the search criteria and a count. In essence if I searched for the name “Troy” if there are 500 names that meet that criteria, I would like to see that 500 count in the results followed by all 500 names that contains “Troy.” Please advise.

Looking forward to hearing from you soon.

Troy,

   The eSearch is not setup to be able to search multiple field for one entered value. The queryTask which the eSearch uses is not really the best for that. The FindTask on the other hand is specifically designed for just such as operation. The WAB OTB search widget is best suited for your desired workflow. The Search widget allows for multiple fields (searchFields) to be specified on a layer.

Troy Dawson

I have one search item set up to search across three fields.  What I did was in the main configuration window I created a search based on my DeedHolder1 field and saved that.  Then, I went into apps\#\configs\eSearch\config_EnhancedSearch.json and modified the "sqltext" value of that search item to this:

"sqltext": "Upper(DeedHolder1) LIKE Upper('%[value]%') OR Upper(DeedHolder2) LIKE Upper('%[value]%') OR Upper(DeedHolder3) LIKE Upper('%[value]%')",

I don't know if rscheitlin‌ advises against this or not but this has worked for me for 2+ years.

Adam thanks for sharing this. It does work as you know, but the widget settings UI is not designed to support this. Other than the settings UI not being designed to support this, there is no issue at all with your setup.

Good to know.  Thank you.

I am having an weird issued on one of my search expressions using the eSearch v2.4 and WAB 2.4. .  I am trying to search by Parcel ID that is a 9 digit number inside a text field for example 010008909.  The problem I am having it is not searching numbers after the 6 digit spot.  So If I search 0100 or 1000 or 000 I get results but if I search 8909 or 10008 I get no results.  I am using the exact same service with a WAB 1.1 and eSearch v1.2.0.5 with no issues.  Looking at the code configuration for this search also looks the same.  I also have a Party Name search set within the same layer and this appears to be functioning correctly.

V2.4

"alias": "Parcel Number",
"textsearchlabel": "Search by Parcel Number",
"values": {
"value": [
{
"fieldObj": {
"name": "PID",
"label": "PID",
"shortType": "string",
"type": "esriFieldTypeString"
},
"valueObj": {
"value": ""
},
"prompt": "PID contains",
"textsearchhint": "010008909",
"sqltext": "Upper(PID) LIKE Upper('%[value]%')",
"operation": "stringOperatorContains"

v1.2

"alias": "Parcel Number",
"textsearchlabel": "Search by Parcel Number",
"values": {
"value": [
{
"fieldObj": {
"name": "PID",
"label": "PID",
"shortType": "string",
"type": "esriFieldTypeString"
},
"valueObj": {
"value": ""
},
"prompt": "Parcel ID contains",
"textsearchhint": "010008909",
"sqltext": "Upper(PID) LIKE Upper('%[value]%')",
"operation": "stringOperatorContains"

Lindsey,

   Are there any errors present in your browsers web console when the search fails?

No errors, just the No results in the widget.

What does the query string that is written in the console look like?

Robert Attached is a screen shot of the console.  I used firefox and chrome and got similar results.  I did one search using the party name which is a second search expression in the same layer, one with a working parcel id search and one with the "no results" on a parcel ID search using 8909.

Lindsey,

   When I added your url and set the search expression to PID contains, ask for values. I had no problem returning results for 8909. So there must be something in your config from 1.2 that is causing a problem in 2.4.

Robert,

I didn't import or copy any configs settings from 1.2 into 2.4,  I completely re-set it up just using the same parameters in WAB thru the widget config window.  I even removed the expression and re-added it.  Maybe i can try removing the layer completely and re-adding it.

Yes,

   I would give that a try as I said it worked fine for me using your data url.

Greetings Robert,

The search widget does everything I need except provide a "count." The Inland Revenue Department needs a workflow that has an owner name entered and sum of that search in the results. Is there a FIndtask widget that can be used?

Greetings Adam,

I will give this a go and report back.

Does this work with the 10.5.1 built in appbuilder.  Have added as a custom widget,  shared with everyone.  however when clicking the widget get a spinning / waiting and nothing appears to happen.

Troy,

   Then I would use Adam's solution and just add 10 ORs to your SQLText.

Phillip,

   I have not used 10.5.1 Portal so I can't say. Are there any errors in the browsers web console?

Hi

No errors

Just the timer symbol. Tried in firefox and firebug does not show any problem or errors

I would try in Chrome and see if there is anything reported in the web console there.

Robert,

I removed the layer completely and re-added it and them seemed do the trick.  I however did notice another little bug.  My Auto zoom to search results is not working.  When I do a search the map stays at the current extent, even when there is only one result.  I deleted the widget completely in the client apps folder and put a fresh copy of it back in there and reconfigured the app and it still doesn't do it.

Lindsey,

   Do you see any errors in the browser's web console?

No errors.

In the widgets setting dialog what do you have the zoom scale set to? Is it a point layer, polyline or polygon?

Robert,

In regards to the auto Zoom I finally saw in the individual search layers configuration in the Search widget that there is an auto zoom in the Global Settings Override.  I guess I was confused or didn't realize that I needed to have this checked also even if I have it checked in the initial window of the Search widget.

Secondly, I think I figured out the root of the problem with it not searching past so many digits on a numbered search.  When I initially removed the layer completely and put it back in there I tested it only by putting in the search expression and not configuring anything else and it worked fine.  I have now finished setting up the layer and it stopped working.  I have found that when I put in an Item sorting criteria (which is by one field) it doesn't allow the results.  When I remove it the results are found again.  I have tried to to sort by initial one (Party Name) and by PID and both fails my search results.  I have the sorting set up on other layers without issue but the rest of the layers results are combination of letters and numbers unlike this one where it is all numbers.  Also, this sorting was not an option on by earlier version of the search widget which might explain why I hadn't run into this problem before.

Thanks for the help Robert!

Lindsey,

   Thanks for updating me on the sort issue. I will have to take some time and look at that.

Robert,

This is a great widget, thanks so much.  I have a use case where I have over 100 fields and in many instances only 15-20 of those are populated.  Can you advise me on how to return only the fields that have a value in the search results?  It would be nice if users didn't have to scroll through the whole list.  I imagine this is possible, but I am not sure how to code that.  Do you have any ideas?

Thanks,

Adam

Anonymous User

So Adam if I can ask, the concept would be if it detected field.length < 1. And additionally if the value was was a word such as 'null' or '0' or similar. (Or perhaps even other words e.g. NoData, None, etc)  In terms of pseudocode.  Now if it is simply hiding the same fields always, he added a box to uncheck everything, then check on specific fields. (I am so grateful he added that a while back). But your case it sounds like sometimes the field would have values, and sometimes not. So you only want to show it when they've got data.  That does sound useful. I'd leverage it on our property layer.

Robert Scheitlin, GISPPhilip Hughes‌ I was able to get the widget to work in the "new" 10.5.1 Custom Widget deployment approach by changing the following lines in the code, all in the "setting" folder:

  • for any .js file in the /setting folder that references another script in the define() like 'widgets/eSearch/setting/AddFieldBtn', change the syntax to './AddFieldBtn' (dot-relative) -- basically replacing 'widgets/eSearch/setting' with '.' wherever it appears in a define()
  • in setting/IncludeBotton.js and setting/IncludeAllButton.js, change the last line in define() from 'dojo/i18n!./nls/strings' to './nls/strings'

I don't know enough JS or about how this was developed to know if these changes should go into the actual release of the app, I'll let Robert speak to that.

Yes, Kevin, that is correct.  The idea would be to hide a field from the results if that field was empty, or had a null value.  It would be very useful in limiting the results so users don't have to scroll through a long list of blank values.  Really, I would like to see this in the pop-up window as well.  I just thought I would reach out to see if it's something Robert has thought about adding to his custom widget at any time. 

Adam,

   OK now I understand what you are asking for. I like this idea and will try to get it into the next release (2.5).

Hi Robert!

I apologize if this has been asked before but I can't seem to figure out how to search through only these comments.

I am trying to pass more than one search string via URL using a pipe according to the help. I am testing it out on your demo site using:  esearch=1998|54962&slayer=3&exprnum=0 to have it find two parcels and it doesn't seem to work. Am I misunderstanding this functionality?

Ultimately what I want to do is take a list of parcel IDs and have it search for all of them at the same time using a URL parameter.

Again, thank you for everything you do!!

Lee,

   The pipe is for delimiting values that should go in different fields (boxes) in the eSearch widget UI.

i.e. http://gis.calhouncounty.org/WAB/V2.4/widgets/eSearch/index.html?esearch=RESIDENTIAL|URBAN%20NEIGHBO... 

If you want it to search for both 1996 and 54962 then you have to switch your expression to use "in"  and not equals or contains and use "esearch=1998,54962&slayer=3&exprnum=0"

Anonymous User

Hey Sam Libby, this solution is close on my end, but doesn't completely work. The eSearch configuration page loads with your changes, but when I click on 'Add a Search Layer', it crashes because of SingleSearchEdit.html. I tried changing the data-dojo-types that reference other scripts to be dot-relative, but it's out of scope in this file. It's trying to look for /arcgis/jsapi/jsapi/dojo/IncludeButton.js. So I tried an absolute path, which fixed the problem for the LayerFieldChooser type, but IncludeButton and IncludeAllButton are still broken. Here's the error on Chrome:

Chrome error message

Do you (or anyone else) know why changing the data-dojo-type path isn't working with types that use nls/strings in 10.5.1? I'm a JavaScript/WAB developer newbie, so I hope somebody knows the answer.

Edit: I'm also seeing this issue in Robert's Identify widget for setting/IdentifyLayerEdit.html when deployed in 10.5.1.

Alexandra,

  I am working on this right now and hope to have a fix soon.

alexandra.washburn‌ & SLibby-esristaff‌, Can you two give version 2.4.1 a try and see if the issue in portal are resolved?

Anonymous User

Hey Robert! Thank you so much for looking into 10.5.1 compatibility! Unfortunately, this build isn't working. When I added the widget to my app, the configuration page won't load, and this message appeared:

Chrome error message

I dropped your widget straight into wwwroot (for now), so the path it's trying to use is correct. I see in your build that IncludeButton and IncludeAllButton still have 'dojo/i18n!./nls/strings' in the define. When I followed Sam's instructions to change this to './nls/strings', I was able to get past this error, but it just leads to the error I showed above.

Well back to the drawing board for me then.

Version history
Last update:
‎11-22-2022 07:31 AM
Updated by: