Enhanced Search Widget Version 2.23.1 - 11/22/22

544580
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
JamesMarok1
New Contributor III

This is a tiny thing I noticed but I don't even know where to begin with what changed. Widget 2.4 on the Left has a X to clear the search field and 2.6 doesn't have that any longer?

RobertScheitlin__GISP
MVP Emeritus

James,

hmm... I went back to my 2.4 version and I don't see that "x".

http://gis.calhouncounty.org/WAB/V2.4/widgets/eSearch/index.html?esearch=I-71&slayer=1&exprnum=0 

JamesMarok1
New Contributor III

I think it only works in IE investigating it more.

MartinOwens1
Occasional Contributor II

Is there a way to set the graphical search to always stay active when the widget is active? I know there is the setting to keep graphical search enabled, but as soon as the onClose function is called and the widget is reopened the graphical search is no longer enabled.

RobertScheitlin__GISP
MVP Emeritus

Martin,

  Sure just make this change to the onOpen function (lines 10- 12):

      onOpen: function () {
        if (!this.config.bufferDefaults.addtolegend) {
          if (this.graphicsLayerBuffer) {
            this.graphicsLayerBuffer.show();
          }
        }
        if (this.tempResultLayer) {
          this.tempResultLayer.show();
        }
        if(this.autoactivatedtool){
          this.drawBox.activate(this.autoactivatedtool.toUpperCase());
        }
      },
MartinOwens1
Occasional Contributor II

Thanks Robert!

MartinOwens1
Occasional Contributor II

Is there a way not zoom to the extent of the results if more than 1 feature is found?

RobertScheitlin__GISP
MVP Emeritus

Martin,

  These customization of the eSearch widget questions really belong in new threads.

MartinOwens1
Occasional Contributor II

Oh ok I'll create a new one.

DavidColey
Frequent Contributor

Hi Robert et al: I am finding that thus far, the 2.6.1.1 build is working without error in 2.7 for my tabbed theme.  I did change the manifest.json when I brought the widget into the stemapp to read

"wabVersion": "2.7",

otherwise my graphical and query searches are behaving as expected.  I am not using any spatial searches. No issues with results formatting our output, the builder gui or anything. 

James_001
Occasional Contributor II

Hi Robert, 

I hope everything is going very well with you! Is it possible to add data from my web map in eSearch Widget? I can find only the rest URL. Since most of widgets work with the direct web map and I want to cooperate with the same data.

RobertScheitlin__GISP
MVP Emeritus

Irfan,

  you can work with the same data that is in your web map I just don’t provide a user interface to choose a layer from the map. You have to know the url that the web map uses for that layer.

James_001
Occasional Contributor II

Thanks Robert! How to add data in eSearch widget from layer.id == 'MyData_1234' ?

DavidColey
Frequent Contributor

Hi Irfran - 

It depends on how you have added your layers to your webmap.  If your layers are hosted in your ArcGIS Online org, then the url will look something like this:

https://services3.arcgis.com/someLongIDNumber/arcgis/rest/services/Hospitals/FeatureServer/0

if you have added a SECURE layer to your org from your ArcServer and then added the layer to the webmap, then your url will something look like this:

https://utility.arcgis.com/usrsvcs/servers/someLongIDNumber/rest/services/ScOperational/SCWaterServi... 

if you have added a layer directly into your webmap from your ArcServer your url will look something like this:

https://yourWebAdptorAlias.something/arcgis/rest/services/OperationalMapServices/yourServiceName/Map... 

you can look at Robert's widget help here:

Web AppBuilder for ArcGIS | Help - Enhanced Search widget 

James_001
Occasional Contributor II

Hi David,

Thanks for your reply! I have a secure layer coming from ArcServer and then added the layer in webmap. I am looking a way where I can give my data to eSearch Widget from webmap layer.It is because some of widgets they don't take direct url such as infographic , Situation Awareness, and InfoSummary Widget. For them data must be coming from webmap. I will really like any idea or suggestions.

Irfan

RobertScheitlin__GISP
MVP Emeritus

Irfan,

  those other widgets need the layer to come from the web map and the eSearch is not map layer dependent. One of the benefits of the eSearch is that there is no need for the layer that is to be searched to exist in the map. I have no plans to add the convince capability of choosing a layer from the web map to be used in the widget, when it is just as easy to know your data and the url that was used to add the service to the web map originally.

ikbelkachbouri
New Contributor II

Hi Robert , 

please how can i show the result of filter widget in map (selection) and how can i open the result automatically in attribute table .

RobertScheitlin__GISP
MVP Emeritus

Ikbel,

   Please do not post a question multiple times in different places.

Here is your other thread where I have answered this question.

https://community.esri.com/thread/163071?start=0&tstart=0#comment-743802 

CCWeedcontrol
Occasional Contributor III

Robert,

On the can the hyperlink be moved to the top of the results table instead of the bottom and if so how?

Do your widgets version numbers only work with the versions of WAB?

For example the Enhanced Search Widget Version 2.6.1.1 is only for WAB 2.6?

The Identify Widget Version 2.5.0.1 is only for WAB 2.5?

RobertScheitlin__GISP
MVP Emeritus

If I do not produce a new widget (i.e. Identify widget is still version 2.5.01) that means that I have had no changes to the code and it will work in the latest versions of WAB.

If Do not have any changes and there is no breaking changes in the latest WAB there is no need for me to just increment the version number of the widget.

As far as moving the the links to the top of the widget. That is a customization of the widget that you will need to start a new thread on. This thread is getting way to big for me to continue to give customization advice on.

CCWeedcontrol
Occasional Contributor III

ok, thanks.

LindseyStone
Occasional Contributor III

Robert,

Have you ever seen an issue when doing a search on the eSearch it doesn't list all the features.  For example it finds 5 features that match, it says Features selected: 5 but only lists out 4 features, and all 5 features are highlighted on the map.  I have this happening randomly on my Parcel layer.  I am using WAB 2.4 and version 2.4 or the eSearch widget.  Below is a link to our live site.  If you do a Parcel ID search on 6670 it comes back with 2 results, highlights both on the map in blue but only lists 1 out.  Same thing if you search my Parcel/owner name by Smitty it comes back with 20 results but only lists 14 features.  We did tweak the widget a little to be able to add our Deed link based on spatial reference.  I was hoping you could advise in which direction I should take in troubleshooting.

Land Use GIS Website 

RobertScheitlin__GISP
MVP Emeritus

Lindsey,

   Your added code at this line is whats causing the issue.

var paramCount = this.deedURL.match(/&/gi).length; // this.deedURL.count(pattern);‍

The this.deedURL.match(/&/gi) is null so length is not a property of null.

RobertMarros
Occasional Contributor II

I was playing around with this widget and was thinking that it could be useful for a Web App that I am building. Right now I am struggling with the "out of the box" Esri widgets because I am trying to view photos from a related table. Is this something that your widget can handle? Viewing images from a related table? 

Thanks 

RobertScheitlin__GISP
MVP Emeritus

Robert,

   How are the photos stored in the related table? Are they attachments or url links in a field?

RobertMarros
Occasional Contributor II

Robert,

I believe they are stored as attachments. Have you had any experience with feature layers created via the Survey123 connect application? I used Survey123 connect to publish the feature, and in doing so, used the Repeat functionality, to create the related tables that house the attachments. Unfortunately following this approach has prevented me from being able to view the photos like I normally would have been able to do if the attachments were housed within the feature layer, and not the related tables. 

Hopefully what I wrote makes sense.

Thanks

RobertScheitlin__GISP
MVP Emeritus

Robert,

  I am not very familiar with Survey 123. But the The info provided is enough for me to give you the bad news. My widget will not be able to aide you with viewing the images.

RobertMarros
Occasional Contributor II

Robert,

That's ok. Thanks for getting back to me.

MikeJones7
New Contributor III

After showing results of a search is there a way to highlight the geometry when hovering over in the attribute table?  

RobertScheitlin__GISP
MVP Emeritus

Mike,

   In the 2.7 version of the widget I will be adding a selection highlight when you click on a record in the widgets results, but not a highlight when you hover using the Attribute Table Widget.

CCWeedcontrol
Occasional Contributor III

I was trying too upgrad the eSearch widget from 2.6 to 2.7 in a applicaiton that is built. I copied\replaced the new 2.7 eSearch widget folder to the \server\apps\12\widgets folder. I opened up the app 12 made some changes to the WAB configuration eSearch widget and saved but the eSearch widget is still showing to be 2.6 (ctrl+alt +click on the widget). what i am doing wrong?

RobertScheitlin__GISP
MVP Emeritus

Hmm... Not sure whats going wrong. Your workflow sounds right. Can you check the manifest.json in the zip that you think is 2.7 and verify you have the right zip file?

CCWeedcontrol
Occasional Contributor III

After looking at the manifest.json i didn't replace it, It still said 2.6. Not sure what happen but i could have sworn i replaced. 

Anyways copy replaced the folder and it looks like the app is at 2.7 now. Thanks and sorry for the post.

AmalHorchi
New Contributor II

Hi Robert , 

can you help me please  to add print widget to my code . 

<!DOCTYPE html>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1,user-scalable=no" />
<title> Population Totale </title>
<link rel="stylesheet" href="http://js.arcgis.com/3.16/dijit/themes/tundra/tundra.css">

<link rel="stylesheet" href="http://js.arcgis.com/3.16/esri/css/esri.css">

<style>


#HomeButton { position: absolute; top: 90px; left: 20px; z-index: 2; }

html,
body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
#map {
margin: 0;
padding: 0;
}
#feedback {
position: absolute;
height: 390px;
font-family: arial;
margin: 5px;
padding: 10px;
z-index: 40;
background: #fff;
color: #444;
width: 300px;
right: 10px;
top: 10px;
box-shadow: 0 0 5px #888;
}

#legendWrapper {
padding: 10px 0 0 0;
}
#note {
font-size: 80%;
font-weight: 700;
padding: 0 0 10px 0;
}
h3 {
margin: 0 0 5px 0;
border-bottom: 1px solid #444;
}

</style>

<script src="http://js.arcgis.com/3.16/"></script>

<script>
//global vars
var layer, legend;


require([

"esri/map",
"esri/dijit/BasemapGallery",
"esri/dijit/HomeButton" ,

"esri/dijit/PopupTemplate",
"esri/layers/FeatureLayer",
"esri/dijit/Legend",
"esri/renderers/smartMapping",

"dojo/_base/array",
"dojo/dom",
"dojo/dom-construct",
"dojo/data/ItemFileReadStore",
"dijit/form/FilteringSelect",
"dojo/parser",

"dijit/layout/BorderContainer",
"dijit/layout/ContentPane",

"dojo/domReady!"

], function (
Map,BasemapGallery,
HomeButton ,

PopupTemplate,
FeatureLayer,
Legend,
smartMapping,

array,
dom,
domConstruct,
ItemFileReadStore,
FilteringSelect,
parser

) {

parser.parse();

var mapOptions = {
basemap: "topo",
center: [11,34],

zoom: 6,
slider: true ,


};


var map = new Map("map", mapOptions);







var basemapGallery = new BasemapGallery({
showArcGISBasemaps: true,
map: map
}, "basemapGallery");
basemapGallery.startup();

basemapGallery.on("error", function(msg) {
console.log("basemap gallery error: ", msg);
});













// map.enableKeyboardNavigation();

var home = new HomeButton(
{
map: map
}, "HomeButton");
home.startup();




var fieldName = "PopTot2004";

// the counties map service uses the actual field name as the field alias
// set up an object to use as a lookup table to work with user friendly field names

var fields = {
"PopTot2004": "Population Totale (2004)",
"PopTot2005": "Population Totale (2005)",
"PopTot2006": "Population Totale (2006)",
"PopTot2007": "Population Totale (2007)",
"PopTot2008": "Population Totale (2008)" ,
"PopTot2009": "Population Totale (2009)" ,
"PopTot2010": "Population Totale (2010)" ,
"PopTot2011": "Population Totale (2011)" ,
"PopTot2012": "Population Totale (2012)" ,
"PopTot2013": "Population Totale (2013)" ,
"PopTot2014": "Population Totale (2014)",
"NOM" : "NOM"


};
var outFields = ["PopTot2004", "PopTot2005", "PopTot2006", "PopTot2007","PopTot2008","PopTot2009","PopTot2010","PopTot2011","PopTot2012","PopTot2013","PopTot2014","NOM"];

//create popup
var popupTemplate = new PopupTemplate({
title: "{NOM}",
fieldInfos: [


{
"fieldName": fieldName,
"label": fields[fieldName],
"visible": true,
"format": {
places: 0,
digitSeparator: true
}
}],
showAttachments: true
});

layer = new FeatureLayer("http://41.231.36.249/sirgeo/rest/services/SIR-Gouv/demographie_gouv/MapServer/0", {
"id": "Chad",
"infoTemplate": popupTemplate,
"mode": FeatureLayer.MODE_SNAPSHOT,
"outFields": outFields,
"opacity": 0.8


});

//only working with Washington state
//layer.setDefinitionExpression("Region='NO'");
map.addLayer(layer);



layer.on("load", function () {
createRenderer(fieldName);
});

function createRenderer(field) {
//smart mapping functionality begins
smartMapping.createClassedColorRenderer({
layer: layer,
field: field,
basemap: map.getBasemap(),
classificationMethod: "quantile" ,
numClasses:3,
//ClassBreakInfo(null, minValue:100000, maxValue:250000),

showOthers:false

}).then(function (response) {
layer.setRenderer(response.renderer);
layer.redraw();
createLegend(map, layer, field);
});
}

//this function gets called when fields are selected to render
function updateAttribute(ch) {
map.infoWindow.hide();

var popupTemplateUpdated = new PopupTemplate({
title: "{NOM}",
fieldInfos: [{
"fieldName": ch,
"label": fields[ch],
"visible": true,
"format": { places: 0, digitSeparator: true }
}],
showAttachments: true
});
layer.setInfoTemplate(popupTemplateUpdated);
createRenderer(ch);
layer.redraw();
createLegend(map, layer, ch);
}

//Create a legend
function createLegend(map, layer, field) {
//If applicable, destroy previous legend
if (legend) {
legend.destroy();
domConstruct.destroy(dom.byId("legendDiv"));
}

// create a new div for the legend
var legendDiv = domConstruct.create("div", {
id: "legendDiv"
}, dom.byId("legendWrapper"));

legend = new Legend({
map: map,
layerInfos: [{
layer: layer,
title: "Indicateur: " ,

}]
}, legendDiv);
legend.startup();
}






// create a store and a filtering select for the county layer's fields
var fieldNames, fieldStore, fieldSelect;
fieldNames = {
"identifier": "value",
"label": "name",
"items": []
};
array.forEach(outFields, function (f) {
if (array.indexOf(f.split("_"), "NOM") == -1) { // exclude attrs that contain "NAME"
fieldNames.items.push({
"name": fields,
"value": f
});
}
});

fieldStore = new ItemFileReadStore({
data: fieldNames
});
fieldSelect = new FilteringSelect({
displayedValue: fieldNames.items[0].name,
value: fieldNames.items[0].value,
name: "fieldsFS",
required: false,
store: fieldStore,
searchAttr: "name",
style: {
"width": "290px",
"fontSize": "12pt",
"color": "#444"
}
}, domConstruct.create("div", null, dom.byId("fieldWrapper")));
fieldSelect.on("change", updateAttribute);

});





</script>
</head>

<body class="tundra">

<div data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design:'headline',gutters:false" style="width: 100%; height: 100%; margin: 0;">
<div id="map" data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'">

<div id="feedback">
<h3>Population Totale(milliers habitants) </h3>
<div id="info">
Sélectionnez une année pour une visualisation cartographiqe .
</div>
<div id="legendWrapper"></div>
<div id="fieldWrapper">
Veuillez choisir l'année
</div>
</div>
</div>
</div>

<div id="HomeButton"></div>

<div style="position:absolute; left:20px; top:150px; z-Index:999;">
<div data-dojo-type="dijit/TitlePane"
data-dojo-props="title:'Fond de carte', closable:false, open:false">
<div data-dojo-type="dijit/layout/ContentPane" style="width:380px; height:280px; overflow:auto;">
<div id="basemapGallery"></div>
</div>
</div>
</div>

</body>

</html>

RobertScheitlin__GISP
MVP Emeritus

Amal,

  You need to start a new thread as this tread is for questions about my eSearch widget.

ZhujingXia
Occasional Contributor II

Robert,

I found an issue with the enhanced Search Widget even in this 2.7 version. The date field shows in the Enhanced search widget is different than the Identify widget. The result in Identified widget is correct but not in Enhanced Search Widget.

For instance, the date in my case  should be 09/24/1971, but it shows as 09/23/1971. Do you know where should I change the code?

Thanks

Zhujing

RobertScheitlin__GISP
MVP Emeritus

Zhujing,

  Do you date fields contain a time or just a date? Comparing the Identify with the eSearch is like apples and oranges as the identify uses a completely different task and means of getting the data from the server.

ZhujingXia
Occasional Contributor II

It is only the date no time.

ZhujingXia
Occasional Contributor II

Robert,

When I used ESRI's search widget I got the result back for the date as '9/23/71, 8:00 PM'. Why it shows the time? I have no idea.

Zhujing

JamesMarok1
New Contributor III
ZhujingXia
Occasional Contributor II

It looks like I have to Convert Time Zone to UTC.

RobertScheitlin__GISP
MVP Emeritus

I personally would just run a field calculator on the date fields to add a time portion like 1PM to all your dates.

JasonHarshman
Occasional Contributor

Hello,

I am experiencing an issue where version 2.7 of the eSearch widget's settings hang after adding it.

The console log shows the following:

stemapp/jimu.js/ServiceDefinitionManager.js?wab_dv=2.4 net::ERR_ABORTED

Error: scriptError   (init.js:36)
  at f (init.js:10)
  at HTMLScriptElement.<anonymous> (init.js:35)

This is happening with the eLocate as well but I had no issue with adding PopupPanel. 

Any ideas?

RobertScheitlin__GISP
MVP Emeritus

Jason,

   Are you trying to run these widget in WAB 2.4?

JasonHarshman
Occasional Contributor

Hi,

Thanks for the reply. Not sure on the WAB version, but we're using Portal 10.5.1.

RobertScheitlin__GISP
MVP Emeritus

Jason,

  I will try and do some testing with Portal (I don't currently use Portal). I was pretty sure that other have eSearch working in Portal though. 

DavidTreering2
New Contributor III

I'm querying very a very large parcels dataset (~1.8M records) and the search fails sometimes.  Is there a timeout set to 1 minute or so for queries?  I upped the memory based on the AGS error, but it seems like the application is timing out before the server times out or reaches a limit.

RobertScheitlin__GISP
MVP Emeritus

David,

   The default timeout used by the API is one minute. You would have to add 

esriConfig.defaults.io.timeout = 1800000; //Meaning wait 3 minutes
DavidTreering2
New Contributor III

Thank you, that’s what I needed.

TaylorHelgestad
New Contributor

Hello,

Can the enhanced search widget query a related table directly? After setting the data search URL input to the rest services URL of my related table I continue to receive a search failed! error when attempting to perform a search. I have had luck with using the "Add Relate" functionality however, this is insufficient for my needs because I need the "Search Expression" functionality to work with my related records alone. If this is not working by default, is there an easy code work-around?

Please excuse me if this question has already been answered - I had trouble finding the information. Thanks for all the great work Robert.

Taylor

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