Enhanced Search Widget Version 2.23.1 - 11/22/22

532053
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

John,

   Can I assume that this is a mistake

search widget and imported into my ArcGIS Viewer for Flex

since this is the Web AppBuilder space?

I understand this is the wrong forum. I couldn’t find the right place to contact you for the Enhanced Search Widget version 3.7.4 for FlexViewer 3.7

I just need to configure the flex widget for it search a particular field.

John,

OK here is the latest thread for the Flexviewer eSearch widget questions:

Enhanced-Search-Widget-for-FlexViewer Part III

When you download the widget there is a help pdf in the download that should answer basic widget configuration questions.

Robert,

I've deleted the eSearch from the stemapp/widgets folder of the WAB Dev and replaced it with the newly downloaded version. Still no new options...

I followed these same steps about four or five times yesterday and twice today. It finally worked. This is not the first time I've had trouble getting the newest version to work the first time. Thank you very much for taking the time to help me get it going. We would be lost with out the eSearch widget. It is the most valuable widget we utilize.

Thanks!!

Jordan,

  Strange it took so much to get it working but glad it is finally.

Robert,

I have a search (point features) and I enabled popups when results are clicked, and enabled the results to be added as an operational layer.  Do you have any idea if "Enable Pop-up" on the results operational layer could be turned ON by default?

The reason I would like to do this is because if you click a result item feature on the map to see its info popup, and there happens to be multiple features at that point (for example, several traffic studies at a single milepost), then the popup doesn't indicate that there are multiple features where you clicked.  Like how the standard popup might display "1 of 2" with the arrows to scroll between them.  Back to my question, if you enable popups on the results operational layer, then it works exactly the way I would like to see it.  So I'd love to be able to have that option enabled by default when the results layer is added.

Regarding my previous post about enabling popups on the eSearch results operational layer, I was able to modify the widget for this to work.  It fixed the problem I was having with popups on overlapping features in the search results.  I used the following thread to get it working:  https://community.esri.com/thread/159817

Ryan,

  OK finally I understand what you are after and were trying to explain to me (some times I am just thick headed). I will be looking at adding this to the next release.

Ryan,

  Not sure if you used the code from that post exactly or not but if you did you are taking a big hit as there is no need to load the LayerInfos just to enable the popup on the search result layer. I will have this in the next release but if you want to see how I implemented it let me know and I will post it.

Hi.

I am redeveloping an old search application using Web AppBuilder for Developers and the Enhanced Search widget.  All as gone fantastically, except, the old application could produce a smart pdf document showing not only the results, but also the search criteria, at the touch of a button, and therefore the 'export to csv' option is not fulfilling my customers' needs.  Is it possible that this could be a future enhancement?  Otherwise, could anybody please advise how I can access the search terms, or geometry, in order to insert into a document, along side the attribute table results.  Apologies if this is a daft question, but I am a JavaScript beginner!

Thanks,

Helen

Helen,

  Can you provide an example of what you are looking for?

Hi Robert,

Below is an example of the required output - so the search criteria is displayed as well as the results.  Users can search by a number of different parameters, such as colliery or seam name and filter by the working types, as well as searching graphically.

thanks,

Helen

SampleSearchOutput.jpg

Robert,

I'd be interested to know how you implemented enabling the popup if you get a chance, since I did use the code pretty much just like in that post I linked to.  I'm not highly skilled in programming so it took a lot of head scratching and a prayer to get it to work, hah!

Helen,

  The output to a pdf is no something I will likely add to the eSearch. As far as how to get the selected search criteria you can see how I do this in the Widget.js buildWhereClause function.

Ryan,

  I added this function to the Widget.js

_getDefaultPopupTemplate: function(object) {

        var popupTemplate = null;

        if(object && object.fields) {

          var popupInfo = {

            title: object.name,

            fieldInfos:[],

            description: null,

            showAttachments: true,

            mediaInfos: []

          };

          array.forEach(object.fields, function(field){

            if(field.name !== object.objectIdField){

              popupInfo.fieldInfos.push({

                fieldName:field.name,

                visible:true,

                label:field.alias,

                isEditable:false

              });

            }

          });

          popupTemplate = new PopupTemplate(popupInfo);

        }

        return popupTemplate;

      },

Then in the _createSearchResultLayer function add the bold text below:

_createSearchResultLayer: function (layerIndex) {

        var resultLayer = null;

        var layerConfig = this.config.layers[layerIndex];

        if (layerConfig.shareResult) {

          //new a feature layer

          var layerInfo = lang.clone(this.resultLayers[layerIndex]);

          //only keep necessary fields

          var necessaryFieldNames = this._getOutputFields(layerIndex);

          layerInfo.fields = array.filter(layerInfo.fields, lang.hitch(this, function (fieldInfo) {

            return necessaryFieldNames.indexOf(fieldInfo.name) >= 0;

          }));

/*Adjust field aliases to those configured in the json*/

          array.map(layerInfo.fields, lang.hitch(this, function (fieldInfo){

            if(necessaryFieldNames.indexOf(fieldInfo.name) >= 0){

              var cnfgFldObj = this._getConfigFieldObject(fieldInfo.name, layerIndex);

              if(cnfgFldObj && cnfgFldObj.alias !== fieldInfo.alias){

                fieldInfo.alias = cnfgFldObj.alias;

              }

            }

          }));

          var featureCollection = {

            layerDefinition: layerInfo,

            featureSet: null

          };

          resultLayer = new FeatureLayer(featureCollection);

         //now setup the infoTemplate

          resultLayer.infoTemplate = this._getDefaultPopupTemplate(layerInfo);

        } else {

          //use graphics layer

          this._resetAndAddTempResultLayer();

          resultLayer = this.tempResultLayer;

        }

        return resultLayer;

      },

Thanks Robert.  I will have to get someone more Java savvy to help me!

Helen

Robert,

Thanks for the fantastic widget.

I've made a widget that takes a URL and parameter and returns a PDF. I've managed to adapt it using dojo/router and it works fine for hard-coded URLs in index.html (for testing). However, it does not work when clicking a search URL (matches the hard-coded ones) from Enhanced Search. I've tried preventDefault and stopPropagation inside my widget which doesn't work of course. I cannot assign a listener to linksDiv because it doesn't exist when the widget autostarts at page load. Do you know a way I could accomplish this? Note that I haven't tested in production yet but the extra bits of the url (mode=config etc) don't seem to matter as the hard-coded URL (#/method/:id) inherits the web root and works. In other words, can I stop Enhanced Search from opening a new tab when clicking the search URL I've added to a given search, or is there another method within Enhanced Search that would allow the URL to be sent through dojo/router? Or is it completely out of Enhanced Search scope due to how widgets work now?

Edit: to be clear, I'm not asking for help with my widget. I would like to stop Enhanced Search from opening a new tab when clicking on a search URL or otherwise learn if it's possible to make it so the URL is consumable by dojo/router. If it's not possible via Enhanced Search then that's the answer I need.

Phillip, I would suggest starting a new thread vs in this thread.

Also, if you get you PDF widget working the way you like, can you share the code?

Am I not in the Enhanced Search Widget thread? My issue relates directly to Enhanced Search Widget code, the solution will probably be something like suppressing the default link behavior directly inside List.js, I might be able to manage it myself but the interaction between the widget's Widget.js and List.js isn't clear to me yet. I assumed (my fault for assuming) that since others were asking questions about Enhanced Search Widget this was the correct method, I'm completely ignorant of the protocol here.

Never say never but unfortunately sharing the PDF widget is extremely unlikely. It's a very customized one-off solution tied to a particular set of feature layers, it would need significant settings development and there's no guarantee everything could be made universally useful.

Oh I think I see what you're saying. I'm not asking for help with my widget, I want to change the behavior of the Enhanced Search widget slightly. I clarified my question.

sorry...I may have misinterpreted it too (read it too fast maybe).  Good luck with your issue.

Philip

I am working on similar functionality for the eSearch widget and having the same questions that you have. Any help that Robert or yourself can provide would be very helpful to me. Even a snippet of code here or there can help immensely.

Thanks to everyone on these threads for being so willing to help.

Kevin Fowler

Systems Analyst

City of Virginia Beach

Center for Geospatial Information Services

2405 Courthouse Dr.

Virginia Beach, VA 23456-9027

Ph: 757-385-1827

Fax: 757-385-8482

kfowler@vbgov.com<mailto:kfowler@vbgov.com>

Phillip,

  The List.js is expecting each link to be a url that it will build an html anchor element for and have the anchors target be _blank. If you need to do something different with a link icon then you need to modify the

array.forEach(item.links, function(link){

loop to create an anchor element or something more suited for your use case.

I don't have enough info to provide a code snippet.

That's enough to get me started, thanks!

Thanks Robert, that's exactly what I needed.

The way this works for me is I have a widget that starts automatically at page load. Inside the widget is my dojo/router code:

startup: function () {

   this.inherited(arguments);

   this.own(router.register("/item/:id", lang.hitch(this, function(evt) {

       this.itemFunction(evt.params.id);

   })));

   router.startup();

}

Then in widgets/eSearch/List.js around line 181 in the array.forEach function, remove the "target='_blank'" portion from the URL string. That's what was breaking it for me. Note: this may break external search results that depend on the target field so it's not one size fits all.

EDIT: Changes it for search results, doesn't change it for the map popup, FYI. For now I'm just disabling it, removing 'target="_blank"' from anywhere else doesn't seem to have an effect.

Woo!

This is going to be a really dumb question, but I am really a beginner at this.

I love Robert's enhanced search widget, works great on our site.  I am running 1.3

Is there an easy way to upgrade to 1.3.0.2?

Can I just replace the contents of the eSearch folder in my inetput/wwwroot/widgets/eSearch folder?

Steve,

  Yes you can do that unless you are using predefined values for one or more of your searches, as predefined values was revamped in the config_Enhanced Search Widget.json. If you are using predefined values then you need to update the widgets in your WAB developer app and then open the eSearch widgets configuration to get the new json format for the widget.

I'm in the process of recreating my Flex Viewer apps with the WAB. I have the eSearch widget running and it works in general. However, I'm wondering if this version supports tables. The only search I'm doing on a table fails, with no useful error message. It just says "Search Failed!" The same search works in the Flex Viewer. Is there special config required for tables?

I also find the "value required..." thing to be confusing. After clicking the checkbox, you have to type something in the text box above to get it to work? This was a simple true/false in Flex Viewer.

One last thing - I'm trying to decide if the Identify widget is necessary or if the graphical search in eSearch can replace its functions. Any comments?

Nick,

   Tables are yet to be supported in the WAB eSearch. I am working on relates right now and then table is next in priority.

I also find the "value required..." thing to be confusing. After clicking the checkbox, you have to type something in the text box above to get it to work? This was a simple true/false in Flex Viewer.

Not sure why this is confusing. If you are making it a required field then you have to supply a default value. Yes this was different in the Flex version but it make more sense (at least to me as the one developing it) to not have a empty text box if you are saying it is required.

Many people are using the eSearch as an identify and replacement for the otb query widget. But be aware that the benefit of the identify widget is that you can identify multiple layers in the map at one time where the eSearch can only do the layer selected.

I'll be looking forward to both of those features!

It's personal preference, but it seems to me that required fields do not usually have default values in most web forms, unless there is a good guess as to what the values are (say you put in your zip code and it populates the town). But if I'm doing a street search and I have 500 streets, choosing one of those to have as a default value will have to be erased 499/500 times, which is more time consuming for the user. I would personally vote to have the default value and the required value operate independently, with the required value just throwing up the "*Required" flag.

I'm sure you've given it thought, but if that's the sole benefit of the Identify widget, what are your thoughts on giving eSearch that capability (something like adding an "All Layers" (or specific configured layers) option at the top of the graphical search menu) and retiring the Identify widget?

I realized I have one more issue. I have a query, FlushingNumber IS NULL. That query fails too, even though I have a null value in the feature class that is queried. I have it set to "is blank" and nothing else on the query form is selected other than the field. Why might that be failing?

Hi Robert Scheitlin, GISP,

Love the widget and every thing seems to be working well the only question i have is how do you turn on suggestions.

In your address example when you start typing it brings up suggestions.

What do I need to do to make that active? 

I have looked in both the setting of the widget and also the settings of the map service and I am not finding anything.

Thanks,

Matt

Matthew,

  In order to have the "suggestions" you have to have one of these conditions.

  1. Your field uses a Domain in the GeoDatabase.
  2. You choose Unique as the field option (the choices are Value, Predefined, and Unique).
  3. You choose Predefined as the field option and manually enter your predefined choices.

Nick,

I will look into the require more to consider if I will change this.

No I will never combine the two as they are completely different back end Tasks that are called one is IdentifyTask and the other is QueryTask. QueryTask is limited to one sub layer of the map service and IdentifyTask identifys against all layers in the  map service.

I realized I have one more issue. I have a query, FlushingNumber IS NULL. That query fails too, even though I have a null value in the feature class that is queried. I have it set to "is blank" and nothing else on the query form is selected other than the field. Why might that be failing?

Having  a field set to isblank and then having a second expression value in the expression should work fine if you set the dropdown in the config as seen below:

"Get features in the layer that match" All  "of this and the preceding expression criteria"

This use to default to All but it look like this broke at some point and I will fix it in the next release. I will also look into the UIs presentation of the field is blank aka "fields IS NULL". I am not sure why I show a text box in the widgets UI when there is nothing that needs to be entered.

Robert Scheitlin, GISP

I have never been able to get unique to activate yet but i will see if i missed something.

Thanks,
Matt

eSearch is the backbone of all my apps. I have the widget running and I'm wondering if there are a few things I can edit. If not, I'd like to submit them for potential feature requests.

It says, "Specify parameters for this search." I'd like to be able to customize that on a per-search level, such as "Search services by street name and number."

Is there a way to configure the widget to have a single box and query more than one field from that input box? So, if I have 3 fields for Owner1, Owner2, and Owner3 for a property, and I want to be able to search for "Smith" on all of them at the same time. Currently, it looks like the user has to enter Smith in 3 fields to do that.

If the user is running a query that takes more than a second or so, near the loading bar, it says "no results." An impatient user may give up or click away, thinking there are no results, but in fact, they just haven't come up yet. Can that be changed to "processing" or just removed entirely unless there are results?

Thank  you for your contributions.
Nick

Nick,

  Request one and three will make it into the next release. Number two has a high LOE and I will have to consider it based on the fact you are the first to request this.

Robert,

I'd like this esearch widget very much.  I have 2 layers used in the esearch, one is parcel layer,user need search for the parcel ID to get a result parcel, and then create buffer around the parcel, then intersect with the  2nd Criteria layer. So i did not checked the "spatial Search Layer" for the first parcel layer since I only like use to Search entities of the 2nd criteria  layer in 'by spatial' tab.  Is that possible to not show the parcel layer in the table at the bottom of the map? I only like to show the results of the Criteria Layer in the table.

Thanks

Zhujing

Zhujing,

   Only search layers that have been configured  by checking the "Show in Attribute Table Widget" will show in the Attribute Table Widget. Unless you have the layer already added to the map and the Attribute Table widget is configured to shoe that layer.

Robert,

I leave the 'Show Attribute Table Widget' as unchecked for the parcel layer, but it is still show in the table widget. Is there a way to not show it in the table widget?

Thanks

Zhujing

Zhujing,

If you have the layer already added to the map and the Attribute Table widget is configured to show that layer then it has nothing to do with the eSearch widget. You have to configure the Attribute Table widget to not show that layer.

Hi Robert Scheitlin, GISP​.  Again, thanks for sharing and updating all of your widgets.  Can you please answer my questions below?  Sorry if these have already been covered in some way.  I am using 1.3.0 or 1.3.0.1 and didn't find anything on the list of 1.3.0.2 updates pertaining to them.

1) For my parcel number search results I want to display four deed holder fields (deedholder1, deedholder2, ...3, ...4) all as the same alias of "Deed Holder."  Are you aware of this being a problem or would you advise against it?  When I execute the search the results window matches what I want, as does the Attribute Table display.  However, when I export to CSV the deed holder field values all take on the value from the last instance of the alias "Deed Holder."  For example, if deedholder1 = "Smith, Joe", and deedholder2 through 4 are blank/null, then all values for the "Deed Holder" columns are blank/null, assuming I have the results setup to show the deedholder fields in ascending order.  See images below.

eSearch results (deedholder1 field = Johnson County, deedholder2 through 4 = null/blank) is correct

Attribute Table display is correct

Export to CSV (column I should = "JOHNSON COUNTY IOWA" but in this case is replaced by the last instance of Deed Holder, or column L) is not correct

Could this be a problem with the Attribute Table widget?  My easy work-around is simply to give them different aliases, but ideally I would like to have them be the same.

2) Is there a setting that will enable the eSearch field results order to carry over to the Attribute table?  As of now mine do not match and I'd like to have the same order in both.

3) It was brought to my attention that when creating a buffer and clicking another layer (other than the first/default layer) in the "Search entities of" dropdown (By Spatial tab) the results displayed in the Attribute Table are those from the first item/default search layer in the eSearch widget.  Should the user be able to pick any item from the dropdown and have its attributes appear there?  Can I configure that?  I want to say this worked in older versions of eSearch but can't remember for sure.  I know it wasn't reported to me until recently though.

Adam,

  Unfortunately both #1 and 2 are Attribute Table Widget issues

#3 is a bug and here is the simple fix. In the Widget.js file search for "this.selectLayerSpatial.addOption(spatialOptions);"

and add these three lines right below that line:

if(spatialOptions.length > 0){
  this.spatialLayerIndex = spatialOptions[0].value;
}

Robert,

Thanks for the information #1 & 2.  As for #3, I tried on a deployed application and one in WAB 1.3 with eSearch 1.3.0.1 and couldn't get it to work.  I did notice there are two instances of "this.selectLayerSpatial.addOption(spatialOptions);" in widget.js, with one around line 852 and another around line 889.  Should it go under both or just one?  Did I miss another spot?

Just so we are clear on what I'm trying to accomplish... I want to create a buffer, then be able to select any one of my search layers in the "Search entities of" dropdown list on the By Spatial tab and see the features from that layer that are intersected by, intersected by an envelope of, etc.  I don't want it to be restricted to the first/default item in that list.

Adam,

   Sorry I forgot you said you were using 1.3.0... The code fix I provided was for 1.3.0.2. I am not sure what it would be for 1.3.0.

Ok.  I'll move up to 1.3.0.2.  Much like 1.3.0.1 though there are two instances of "this.selectLayerSpatial.addOption(spatialOptions);" in widget.js of 1.3.0.2, at lines 882 & 922.  Should Under which line should I add that code?

the 882 one.

Thank you for all of the help.

Thanks Robert. I will look into the attribute widget.

Robert Scheitlin, GISP wrote:

I realized I have one more issue. I have a query, FlushingNumber IS NULL. That query fails too, even though I have a null value in the feature class that is queried. I have it set to "is blank" and nothing else on the query form is selected other than the field. Why might that be failing?

Having a field set to isblank and then having a second expression value in the expression should work fine if you set the dropdown in the config as seen below:

"Get features in the layer that match" All "of this and the preceding expression criteria"

This use to default to All but it look like this broke at some point and I will fix it in the next release. I will also look into the UIs presentation of the field is blank aka "fields IS NULL". I am not sure why I show a text box in the widgets UI when there is nothing that needs to be entered.

l just had a single expression value in my query. Does it only work when you have 2 expression values? I'm just querying one field for a null value. Nothing is required for the user to enter, they just hit the button. I tried to add a second expression with the identical value in it with it set to All, but the result was the same: "Search failed!" I'm not asking for values, prompting, hinting, providing a default value, or requiring a value. I simply want the FlushingNumber IS NULL query to run when the user does nothing but hit the Search button. It's a long integer field, with Allow NULL values set to Yes. It works in the Flex Viewer App.

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