Enhanced Search Widget Version 2.23.1 - 11/22/22

592088
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
Alexander_DanielMena
Occasional Contributor

Hi Robert Scheitlin, GISP, thank you for excellent work with this widget.
I'm working about to show relate table that were loaded in the web map. I achieved load the tables over the widget Attribute Table but at moment of filter the result with the objectid (or attribute relation between tables) not working, then the tables show all records. I use "partsObj" expression and then setFilterObj over the activeTable.
Could you check why the filter not working on active table?

Thank you so much.

/**
* Consultar Tablas relacionadas
*/
_showDetailsinAttributeTable: function (arg) {
debugger;
alert('Consultando tablas relacionadas...' + arg.codigopredio);


this.operLayerInfos.getTableInfoArray().forEach(lang.hitch(this, function(layerInfo) {
console.log(layerInfo.title, layerInfo.id);
layerInfo.setFilter("CODIGO_PREDIO='" + arg.codigopredio +"'");
this._openResultInAttributeTable(layerInfo);
}));


if (this.wManager) {
var widgetCfg = this._getWidgetConfig('AttributeTable');
if(widgetCfg){
var attWidget = this.wManager.getWidgetByLabel(widgetCfg.label);
if(attWidget){
this.wManager.openWidget(attWidget);
var partsObj = {
"expr": "CODIGO_PREDIO='" + arg.codigopredio +"'",
"parts": []
};
console.info(attWidget);
var activeTable = attWidget._activeTable;
activeTable.setFilterObj(partsObj);
activeTable.refresh();
}
}
}
}

RobertScheitlin__GISP
MVP Emeritus

Alexander,

Seems like its a timing issue then. You need to ensure that AT widget is loaded and opened and then set the active table using the _openResultInAttributeTable function and wait to be sure the AT widget is ready (I would use a 1 second timeout) then apply the filter to the activeTable. In you eSearch code I open the AT widget and ensure that the AT Widget is visible by doing these lines:

this.wManager.openWidget(attWidget);
attWidget._openTable().then(lang.hitch(this, this._openResultInAttributeTable, currentLayer));

Alexander_DanielMena
Occasional Contributor

rscheitlin, my WAB version is 2.1

Originally, I used the function "attWidget._tableFunctionController.getActiveTable();" to get the active table but the function "_tableFunctionController" not exist into the object attWidget, then I use "attWidget._activeTable" but I don't know if that is Ok because the filter is not applied. I'm sure that the AT is loaded and opened because the query open the table when found results.

setTimeout(lang.hitch(this, function(){
if (this.wManager) {
var widgetCfg = this._getWidgetConfig('AttributeTable');
if(widgetCfg){
var attWidget = this.wManager.getWidgetByLabel(widgetCfg.label);
if(attWidget){
this.wManager.openWidget(attWidget);
attWidget._openTable().then(lang.hitch(this, function (){
var partsObj = {
"expr": "CODIGO_PREDIO='" + arg.codigopredio +"'",
"parts": []
};
console.info(attWidget);

//var activeTable = attWidget._tableFunctionController.getActiveTable();

var activeTable = attWidget._activeTable;

activeTable.setFilterObj(partsObj);
activeTable.refresh();
}));
}
}
}
}), 5000);

Thank you so much.

RodWoodfordOld
Frequent Contributor

Hi Robert,

When do you think you will have a fix for the date issue when exporting to CSV? Any info would be great. 

Rod

RobertScheitlin__GISP
MVP Emeritus

Rod,

   I have that and some other fixes and enhancements done and started on relates again. I have to much more work to do with relates so I will roll that part back and release 2.1.1 this week.

RodWoodfordOld
Frequent Contributor

cheers Robert, your a good man. The esearch widget is a fantastic tool.

Rod

ScottMoore__Olympia_
Esri Contributor

Hi Robert,

I have downloaded the latest version of eSearch and I am trying to use the export to csv functionality.  I bring in the eSearch widget, and even using one of the demo layers like Lousiville Zoning, and enabling CSV export, when I query by Shape, and try to export the results to CSV, I always get an empty CSV.  I may be doing something silly, but any thoughts you have would be appreciated.


Scott

RobertScheitlin__GISP
MVP Emeritus

Scott,

   When I tested on my live preview site it worked fine with by Shape. I do know about a issue with dates exported in the CSV but nothing about getting a blank CSV. I will be releasing a 2.1.1 version this week to fix the CSV Date issue.

ScottMoore__Olympia_
Esri Contributor

I downloaded WAB 2.1 fresh and copied in the latest eSearch and configured it and it did not work. I will try again on another machine.

RodWoodfordOld
Frequent Contributor

Hi Robert,

Thanks for the 2.1.1 update. I have noticed the REMOVE RESULT option doesn't seem to work anymore. Can you please test to confirm. See screen shot.

Rod

RobertScheitlin__GISP
MVP Emeritus

Rod,

   Thanks for reporting that. For some reason I commented out line 88 of the List.js (and I don't know why). I will re-upload 2.1.1 with that fix but it would probably be just as easy for you to un-comment line 88 on your end.

RodWoodfordOld
Frequent Contributor

Hi Robert,

Is it possible to clear date search fields when clicking the CLEAR FIELDS button. I keep getting conflicts with default date settings and other field searching. See screen shot below. Users are getting frustrated needing to clear this field manually every time they search. Any advice would be great.

cheers

RobertScheitlin__GISP
MVP Emeritus

Rod,

  OK that will take some change to a couple of files:

Widget.js

      clearFields: function () {
        if(this.AttributeLayerIndex || this.AttributeLayerIndex === 0){
          var exInd = this.expressIndex || 0;
          if(exInd > 0){
            this.onAttributeLayerExpressionChange(this.expressIndex);
          }else{
            this.onAttributeLayerChange(this.AttributeLayerIndex);
          }
          var exInd = this.expressIndex || 0;
          var valuesObj = lang.clone(this.config.layers[this.AttributeLayerIndex].expressions.expression[exInd].values.value);
          console.info(valuesObj);
          array.map(valuesObj, lang.hitch(this, function(valObj){
            if(valObj.operation.toLowerCase().indexOf('date') > -1){
              if(valObj.valueObj.hasOwnProperty('value')){
                valObj.valueObj.value = "";
              }
              if(valObj.valueObj.hasOwnProperty('value1')){
                valObj.valueObj.value1 = "";
              }
              if(valObj.valueObj.hasOwnProperty('value2')){
                valObj.valueObj.value2 = "";
              }
              this.paramsDijit.setSingleParamValues(valuesObj, "");
            }
          }));
        }
      },

SingleParameter.js

      setValueObj:function(valueObj){
        //console.info(valueObj.valueObj);
        var shortType = this.value.fieldObj.shortType;
        if(shortType === 'string' || this.numberwithin){
          if(this._type === 1){
            this.stringTextBox.set('value',valueObj.valueObj.value);
          }
          else if(this._type === 2){
            var stringSelectedItems = array.filter(this.stringCodedValuesFS.store.data, lang.hitch(this, function(item) {
              return item.code === valueObj.valueObj.value;
            }));
            if (stringSelectedItems.length > 0) {
              this.stringCodedValuesFS.set('value', stringSelectedItems[0].id);
            }
          }
        }
        else if(shortType === 'number'){
          if(this._type === 1){
            this.numberTextBox.set('value', valueObj.valueObj.value);
          }
          else if(this._type === 2){
            var numSelectedItems = array.filter(this.numberCodedValuesFS.store, lang.hitch(this, function(item) {
              return item.code === valueObj.valueObj.value;
            }));
            if (numSelectedItems.length > 0) {
              this.numberCodedValuesFS.set('value', numSelectedItems[0].id);
            }
          }
          else if(this._type === 3){
            this.numberTextBox1.set('value', valueObj.valueObj.value1);
            this.numberTextBox2.set('value', valueObj.valueObj.value2);
          }
        }
        else if(shortType === 'date'){
          if(this._type === 1){
            if(valueObj.valueObj.value === ""){
              this.dateTextBox.set('value', null);
            }else{
              this.dateTextBox.set('value', new Date(valueObj.valueObj.value));
            }
          }
          else if(this._type === 2){
            if(valueObj.valueObj.value === ""){
              this.dateTextBox1.set('value', null);
              this.dateTextBox2.set('value', null);
            }else{
              this.dateTextBox1.set('value', new Date(valueObj.valueObj.value1));
              this.dateTextBox2.set('value', new Date(valueObj.valueObj.value2));
            }
          }
        }
      },
ChadRicks
Regular Contributor

Hey Robert. This is probably a stupid question but my brain isn't working today. I am setting predefined fields for a value but the value has commas. like "Mission Dependent, Not Critical" and the esearch is separating text by the comma. What do i put in the predefined field to not separate on that comma?

Thanks 

RodWoodfordOld
Frequent Contributor

Hi Robert,

Thanks for the code and prompt reply, it works perfectly clearing date fields, in fact all fields. Could this be added as an enhancement option.

cheers

RobertScheitlin__GISP
MVP Emeritus

Rod,

   That will be added to the next release.

RobertScheitlin__GISP
MVP Emeritus

Chad,

  I had something in place for this in the past but future enhancements to userlists broke that. If you start a new thread asking about this then I will be able attach the updated files and instructions.

RodWoodfordOld
Frequent Contributor

You might need to include the predefined option as well.

RobertScheitlin__GISP
MVP Emeritus

Rod,

??? Chad and I were talking about predefined user lists.

RodWoodfordOld
Frequent Contributor

Yes sorry, Chad followed on from the Clear date issue post. To follow on from your enhancement inclusion post re CLEARING DATE fields, the predefined option also needs to be included as it doesn't clear.

RobertScheitlin__GISP
MVP Emeritus

Rod,

   OK, I forgot that the predefined list creates a drop down that can be cleared.

JamesMarok1
Regular Contributor

I'm sorry if I missed this but there so many posts in this thread now.

Is there a way to get wildcards into the [Value] for the SQL query

I have two records for Owners

Brown  Mark

Brown  Mark / Cindy

I want the users to be able to enter Brown Cind and find the second record, but currently with the %[Value]% structure you would have to enter Brown Mark to find that record as well as the first one. ( I do know if I enter Brown%Cind, I will get the record I want but layperson users not going to enter that is the search box)

Basically I need the spaces in the [Value] to be recognized as wildcards but I know of no way to do that.

RobertScheitlin__GISP
MVP Emeritus

James,

   No there is no option for that. You have contains (%[value]%), starts with ([value]%) or ends with (%[value]).

JamesMarok1
Regular Contributor

😞 very disappointing my Silverlight site has that functionality, but now we would have to take a step backward for our search tool.

RobertScheitlin__GISP
MVP Emeritus

James,

   I would like to know how the silverlight app handled that situation.

JamesMarok1
Regular Contributor

I actually have a Javascript mobile site that development was abandoned on in favor of moving to the WAB, that does that as well, My next attempt is trying to engineer that into a new Search widget, but I am sure your much better than me at that.

RobertScheitlin__GISP
MVP Emeritus

James,

   If you share the code that is working for that I will evaluate it and see if it is something I would be willing to add to the eSearch.

JamesMarok1
Regular Contributor

More than happy too, its a functionality that is very useful to us.

SimpleSearch

RobertScheitlin__GISP
MVP Emeritus

James,

   Thanks for sharing. It looks like the way you are accomplishing what you want is by building a SQL string that does a contains query on each word entered. The resulting SQL statement would look like "NAME LIKE %Brown% AND NAME LIKE %Cindy%". I will have to think about the implications of this.

AndrewNiederhauser1
Deactivated User

Hi Robert, 

I'm using your Enhanced Search widget 2.1. Great widget! I'm setting up a search on various feature classes with less than 100 records and field type: Short integer. I've setup many other searches and they work great. However, I've tried to setup a query with Year Constructed is then select from unique values. In the preview screen and deployed apps, the short integer search on Year Constructed does not seem to be working. Just keeps saying it's retrieving unique values but never returns anything. Other queries using "is" and unique values works great and returns in seconds but they haven't used short integer fields. Any idea what could be causing this hangup?

screenshot from eSearch setup

WAB esearch 2.1 result when setting up query

 screen shot of field properties

RobertScheitlin__GISP
MVP Emeritus

Andrew,

   What Version of ArcGIS Server are you using?

AndrewNiederhauser1
Deactivated User

Robert, 

10.3.1

Thanks, 

Andrew

RobertScheitlin__GISP
MVP Emeritus

Andrew,

   I have tested on two different map services (10.3.1) now using a short Integer field and I have no issue using unique (one of the services had 15K records and another 76K). Can you check your browsers web console for errors?

Alexander_DanielMena
Occasional Contributor

Hi Robert,

I detected that attributes type Date when set it to "Ask for values"  and users no entered a value, the function "buildWhereClause" fail if value is null. Furthermore, when I use the condition "between", the function "_onRangeDateBlur" on SingleParameter.js fail if values are nulls.

I use WAB 2.1 and eSearch version 2.1.

Thanks, I appreciate your help.

RobertScheitlin__GISP
MVP Emeritus

Alexander,

   2.1 version of the eSearch code does not look like that for the buildWhereClause function. You must be using older code.

In True 2.1 version code that error would not occur due to proper handling of the possible null value:

Alexander_DanielMena
Occasional Contributor

Thank you Robert, You are right. I will try to move it to last version.

Regards.

AnninaHirschi_Wyss1
Frequent Contributor

Dear Robert,

I don't know if this is a Server configuration/version issue or if eSearch could handle that.

I have a public service Layer: Village (ID: 0) running on an ArcGIS Server 10.2.x outside of the AGOL subscription used for WAB. I use it in the eSearch widget (only in the search, not added to the AGOL webmap).

The issue with this Layer: I cannot change the order of the fields displayed in the result list and pop up. I use the eSearch pop up for it. In the config file, the order as I want it is there, but it seems to have no effect.

I cannot add sort fields for the result list either.

For services running in AGOL and available in the map, there is no such problem.

Thanks a lot for your help,

Annina

RobertScheitlin__GISP
MVP Emeritus

Annina,

The issue is the older version of ArcGIS Server. Even though I can requesting the fields in a certain order they are not return by the server in that order. I will have the eSearch work around this in the 2.1.2 version.

AndrewNiederhauser1
Deactivated User

Robert, 

I tested multiple services with layers containing number fields (type: short, long, or double). For number fields with null values, the unique values search function would not return values. I'm using Server 10.3.1 and eSearch 2.1.1. 

Thanks, 

Andrew

BL
by
Emerging Contributor

Are there any future plans for this enhanced search widget to work with vector tiles? Thanks!

RobertScheitlin__GISP
MVP Emeritus

Thomas,

   Vector tiles are main for display advantages, and would have little if anything to do with attribute query. I could possibly impact spatial/graphical searches, but right now I have not immediate plans.

RobertScheitlin__GISP
MVP Emeritus

Andrew,

   I must have something to due with the null values then as I mention in my earlier post I tested numeric fields with no issue. What about my latter portion of my response to you? Do you see any errors in the browsers web console?

CristiDelgado
Occasional Contributor

Hi Robert, my enhanced search widget was working but now I cannot access the configure dialog window in the builder (version 2.1) to reconfigure my existing widget or create a new one.  Here's the console error msg (also inserted as image):

init.js:35 GET http://cobmapv2.berkeley.root:3344/webappbuilder/stemapp/jimu.js/dijit/LayerFieldChooser.js?wab_dv=2... q.injectUrl @ init.js:35require.injectUrl @ env.js:288qa @ init.js:32a @ init.js:10(anonymous function) @ init.js:19ja @ init.js:28na @ init.js:19(anonymous function) @ init.js:33a @ init.js:10Xa @ init.js:33s @ init.js:30(anonymous function) @ init.js:35
init.js:36 Error: scriptError(…)(anonymous function) @ init.js:36(anonymous function) @ init.js:14a @ init.js:10q.signal @ init.js:14(anonymous function) @ init.js:35
init.js:37 src: dojoLoader
init.js:37 info: ["/webappbuilder/stemapp/jimu.js/dijit/LayerFieldChooser.js?wab_dv=2.1", Event]
init.js:37 .

I hope you can help me. Esri support was not able to help me.

Thanks,

Cristi

cdelgado@cityofberkeley.info

RobertScheitlin__GISP
MVP Emeritus

Cristi,

   That error will be seen when you are using an older version of eSearch in WAB 2.1 or even earlier. If you replace the eSearch folder with the most current release of eSearch 2.1.1 then that error will go away and as the configuration for the widget resides in a different folder you will not loose your configuration you have done previously.

RobertScheitlin__GISP
MVP Emeritus

Andrew,

   It was a null value in the numeric filed issue and I will have that fixed in the 2.1.2 release.

AndrewNiederhauser1
Deactivated User

Robert, 

Thank you for looking into the issue and all your hard work on these incredible widgets. 

Thanks again, 

Andrew

JamesMarok1
Regular Contributor

I don't know how to get that into single text box to search by, which is where I am stuck, I can replicate it esearch by creating multiple search boxes but I would like to use this default search box in the theme as well.

RobertScheitlin__GISP
MVP Emeritus

James,

  the 2.1.2 release will be able to search in the same way your app does.

BlakeTerhune
MVP Regular Contributor

Is there a way to only display one or two fields in the search results but have all the fields display in the popup? I'm using this with the custom popup panel widget that displays many fields; too many to have all turned on in the enhanced search widget's search results. If I only add one field to the Included Fields list, the popup that shows is missing all of the other field values. The stock search widget only lists one field in the results but displays the whole popup when you click a result.

RobertScheitlin__GISP
MVP Emeritus

Blake,

   You can find in the that there is a "popup only" option on the included fields grid of the add/update layer search setting page.

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