Hello Robert... Just like everyone else, I appreciate the hard work you have done. I have downloaded and installed the Enhanced search widget. I now have it working on my layers. However when I go to remove the default layers (from your Louisville demo), or even just promote mine above yours, I get a "Required Value Missing" error that says "You have failed to enter one or more required values".
You should only get this message when you have set a field as required in the widget settings dialog (i.e. Value is required to be entered to enable search) and then attempt to execute a search without providing a value for that expression value.
Hmm.. I see. However it works fine when "Traffic Cameras" is on the top. When I just promote, my layers to the top and rerun the select by shape (or remove "traffic cameras"), I get this "required" error.
Hmm... Please start a new discussion using the below link that way you can use the advanced editor in GeoNet and attach your config_Enhanced Search.json.
Downloaded WAB 1.3 and the new eSearch widget. Set the widget up with no problems. Thanks for the excellent documentation. I've got a few layers with spatial search turned on. I am only able to get the first search layer to return results. It doesn't matter what layer I select in the drop down menu. For example, I have a value search for Town Range and Section. That search returns the section polygon as expected. I then try to use that resulting polygon to search for the section corners. This search returns only parcels, which is my 1st search layer in the list, and not the section corners. This occurs even though the corners were selected in the drop down menu. I can repeat this behavior by changing the order of the search list.
I can reproduce the issue you are reporting. Sorry about that I not sure when this broke but I will fix it for the next release. If you want to add the one line fix before the next release is out then just open the widget.js file and find the _initLayerSelect function and add this line:
I would personally put it near the other change listeners for the other drop downs towards the end of the function but it should work anywhere in that function.
I had this same question for your Identify tool, so sorry if I sound like a broken record but I have to ask ... does this search tool work on related feature classes, or feature classes that have relationships built into their gdb? Thanks so much,
I would like to take advantage of the 'Export Search URL' that you have added to your esearch widget. However it appears that when you copy and paste the exported search URL into your browser it does not actually zoom to the selected feature. Is this what the intended functionality is supposed to do?
You can see this url works fine http://gis.calhouncounty.org/WAB/V1.3/widgets/eSearch/?esearch=I-64&slayer=1&exprnum=0 which I produced from the Export Search Url link on my live preview site. Likely your issue is you are trying to use this feature on a non-deployed app (i.e. gislap183:3344/webappbuilder/apps/3/). I thought I discussed this in the help doc but now I can not find it mentioned there. I need to add this info back to the help doc
Thanks Robert for your help! Does this mean that I have to set up a proxy page on my production server to gain access to my services on our portal and then make the proxy page a web application?
No. Let me explain a standard workflow. Web AppBuilder is installed on a machine where the application will be developed and configured. Once you are done configuring the app the way you want it, you download the application from WAB (which minimizes the code) and then you take the resulting zip file and unzip it on your production web server (normally not the same machine). The app will no longer run in WAB it will be a independent web site that will have a url that will not contain a port number (like webappbuilder:3344) in the url (in most cases). This fully deployed web site on your web server will now support the use of the "Export Search URL".
You will need to deploy a Proxy on your web server if you plan to allow people to use a buffer as a selection means in the widget though, as the max character count of a html GET will likely be exceeded when using a buffer for searching and the proxy gets past this by switching to html POST instead.
Ok thanks for the explanation Robert! Would there be any other reason for the search URL to not work then on both my development machine and my production one? Do I need to have the layer visibility turned on?
I use the esearch tool to select a watershed unit:
I then select the option to export search url and then paste the following into my browser https://www.mapservices.ca/EBM_WAB/?esearch=3&slayer=0&exprnum=0
The web map loads but just zooms to the initial extent rather than the selected polygon:
OK you must have missed the part where the eSearch widget must be set to pre-load for the url search to work. When you "Export Search Url" you are using the Widgets URL search capability.
Can the esearch widget search on attribute tables? I see that it does not support related tables but am wondering if an attribute table can be searched if I pointed to it via the rest endpoint. The only other work around I can think of to get access to related tables is to create a View using SQL express and publish that.
I've got a single parameter search that uses unique values. The data that is being searched was edited and now contains fewer records than before. The eSearch now won't proceed beyond "Processing unique values" (i.e., Processing unique values: 5667 of 5673).
This can be fixed by clearing the browser's cache, but I really want to avoid situations where I have to instruct users to clear their cache. So for now I'm going to setup my search without unique values, but I really do like using them, it's a great feature!
I had a similar issue with unique values. It would display 'processing' and the processing indicator and stay at that.
I removed eSearch from the WAB and redownloaded it again. I don't know if it was a real issue, but my WAB was secured through SSL and my layers were not secure on my server. I switched the WAB back to regular HTTP and moved the newly downloaded eSearch back to my WAB. It worked after that.
I'm not sure if these suggestions will help you in any way, but it worked for me.
I am using the "By Spatial" search after selecting a feature "By Shape". I have found that when performing "search entities of" intersecting a buffer, the resultant selection is always from the first/top feature class in the drop down list even if i have selected a different layer.
In other words, I can select any feature by shape or attribute from any of three search layers, but when i go to select spatially based on a buffer, the first layer in the search entities list has the selection performed on it. If I go into the widgets user config and change the order of the search layers, the new top item is always selected (even if i choose a different layer).
It may be important to note that i am running Enhanced Search Widget Version 1.3.0.1 - 1/11/16, within Web appbuilder D.E. 1.2
I am currently runing 1.3.01-11/11/16 and i noticed that when i preform a search that the search parcel doesn't get highlighted it just take me to the area. the Edit Default Search Symbology is set. Am i missing something?
thanks for the observation. I didn't catch on that it was using the top layer innthe stack, But that is exactly what it is doing. And. I am seeing the same behavior in version 1.2. I thought that checking/unchecking "Search Layer" would determine if it was used for the query but it isn't. I am looking forward to responses to your item. Thanks again for posting.
Hi 2CDSD 2C, have you tried changing the layer symbology to "from layer" and then selecting "Add\Edit Layer specific symbology"? This is in the widgets configuration for each layer
this is a known issue, and will be fixed in the 1.3.0.2 release but you can look at this reply for the fix if you want to make it yourself before the next release
for some weird reason i can't get the eSearch to find a parcel.When i do a search I get the "search faild!".
weird thing is that i have the Roberts Identify widget using the same layer and it works but it won't find the parcel with the same layer using the eSearch widget. I know the parcel exists because i added the Web appbuilder's "Query" widget and it found the parcel on the same layer. I am not sure what's going on.
Is it possible to add a link or some other text when "No results" are found? We would like to direct our users to another site that may be helpful when they cannot find something on ours.
I like the idea. I will have to look into this. In the mean time if you just want to switch the text "No Results" to something more meaningful then open the [install dir]\server\apps\[App #]\widgets\eSearch\nls\strings.js and replace the noResults property value.
It was ArcGIS online, after removing the feature services and re-adding them and recreating the app seem to work. I am not sure why it was acting up but all seems good now.
I am not sure if this is a bug or not but when i do an eSearch By Shape the map screen truns red and zooms out. Here is how i am doing the eSerch. 1st I select I click on the eSearch Widget, Layer 1 on Search Layer, and select features by " Point" then select a feature on Layer 1 on the map, then use "By Spatial" and "apply a search Distance buffer", then search entities of Layer 2, click on "Intersected by". The features on Layer 2 get selected but the map screen turns red and zooms out all the way.
I also noticed that when you do the eSearch By Spatial and select any layer it doesn't the the spaital search for they layer you selected in Search entities of:. it seems to only search the first layer that you added when you configure the eSearch widget.
';
}
}
}
catch(e){
}
}
}
if (newSub.getAttribute("slang").toLowerCase() != code_l.toLowerCase()) {
if (trLabelsHtml != "") {
var labelSname = "";
if(labelEle[i].querySelector("ul li:nth-child(1)").getAttribute("aria-hidden")){
labelSname = labelEle[i].querySelector("ul li:nth-child(1)").outerHTML;
}
labelEle[i].innerHTML = "";
labelEle[i].innerHTML = labelSname + trLabelsHtml;
}
}
}
}
}
catch(e){
}
}
}
/* V 2.0:3 = Store not translated reply id */
if(lingoRSXML.snapshotLength == 0){
if($scope.falseReplyID == "") {
$scope.falseReplyID = value;
}
}
/* Get translated Body of Replies/Comments */
var lingoRBXML = doc.evaluate(lingoRBExp, doc, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for(var i=0;i 0) {
var attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('div.custom-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else if(rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('#attachments').length > 0){
if ("TkbArticlePage" == "BlogArticlePage") {
attachDiv = rootElement.querySelector('div.lia-quilt-row-main .lia-message-body-content').querySelector('#attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
}
else{
attachDiv = "";
}
}else{
attachDiv = rootElement.querySelector('div.lia-quilt-row-main').querySelector('#attachments').outerHTML;
}
}
else {
attachDiv = "";
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-quilt-row-main').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var k = 0; k < feedbackDivs.length; k++) {
feedbackDiv = feedbackDiv + feedbackDivs[k].outerHTML;
}
}
}
else {
var attachDiv = rootElement.querySelector('div.lia-message-body-content').querySelector('div.Attachments.preview-attachments');
if (attachDiv) {
attachDiv = attachDiv.outerHTML;
} else {
attachDiv = "";
}
/* Everyone tags links */
if (document.querySelectorAll("div.TagList").length > 0){
var everyoneTagslink = document.querySelector('div.lia-quilt-row-main').querySelector(".MessageTagsTaplet .TagList");
if ((everyoneTagslink != null)||(everyoneTagslink != undefined)){
everyoneTagslink = everyoneTagslink.outerHTML;
}
else{
everyoneTagslink = "";
}
}
/* Feedback Div */
var feedbackDiv = "";
var feedbackDivs = rootElement.querySelector('div.lia-message-body-content').querySelectorAll('div.lia-panel-feedback-banner-safe');
if (feedbackDivs.length > 0) {
for (var m = 0; m < feedbackDivs.length; m++) {
feedbackDiv = feedbackDiv + feedbackDivs[m].outerHTML;
}
}
}
}
} catch (e) {
}
if (body_L == "") {
/* V 2.0:7 Replacing translated video data with source video data */
var newBodyVideoData = newBody.querySelectorAll('div[class*="video-embed"]');
angular.forEach($scope.videoData[value], function (sourceVideoElement, index) {
if (index <= (newBodyVideoData.length - 1)) {
newBodyVideoData[index].outerHTML = sourceVideoElement.outerHTML
}
});
/* V 2.0:7 = Replacing translated image data with source data */
var newBodyImageData = newBody.querySelectorAll('[class*="lia-image"]');
angular.forEach($scope.imageData[value], function (sourceImgElement, index) {
if (index <= (newBodyImageData.length - 1)) {
newBodyImageData[index].outerHTML = sourceImgElement.outerHTML;
}
});
/* V 2.0:7 = Replacing translated pre tag data with source data */
var newBodyPreTagData = newBody.querySelectorAll('pre');
angular.forEach($scope.preTagData[value], function (sourcePreTagElement, index) {
if (index <= (newBodyPreTagData.length - 1)) {
newBodyPreTagData[index].outerHTML = sourcePreTagElement.outerHTML;
}
});
}
var copyBodySubject = false;
if (body_L == "") {
copyBodySubject = true;
body_L = newBody.innerHTML;
}
/* This code is written as part of video fix by iTalent */
/* try{
var iframeHTMLText = body_L;
var searchIframeText = "<IFRAME";
var foundiFrameTag;
if (iframeHTMLText.indexOf(searchIframeText) > -1) {
foundiFrameTag = decodeHTMLEntities(iframeHTMLText);
foundiFrameTag = foundiFrameTag.split('src="')[1];
body_L = foundiFrameTag;
}
}
catch(e){
} */
/* This code is placed to remove the extra meta tag adding in the UI*/
try{
body_L = body_L.replace('<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />','');
}
catch(e){
}
/** We should not replace the source content if user profile language and selected target language matches with source language **/
if(showTrContent) {
var compiled = false;
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = null
if("TkbArticlePage"=="IdeaPage"){
// var customAttachDiv = '';
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
compiled = true;
/* Attach atttach div */
// document.querySelector("div.translation-attachments-"+value).innerHTML = attachDiv;
rootElement.querySelectorAll('div.lia-message-body-content')[0].insertAdjacentHTML('afterend',attachDiv);
if(rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message').length > 1){
rootElement.querySelectorAll('div.lia-quilt-idea-message .lia-message-body .lia-attachments-message')[1].remove();
}
} else {
if("TkbArticlePage"=="TkbArticlePage"){
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv ;
}else{
rootElement.querySelectorAll('div.lia-message-body-content')[0].innerHTML = body_L + feedbackDiv + attachDiv;
compiled = true;
}
}
/* Destroy and recreate OOyala player videos to restore the videos in target languages which is written by iTalent as part of iTrack LILICON-79 */ /* Destroy and recreate OOyala player videos */
try{
// $scope.videoData[value][0].querySelector("div").getAttribute("id");
for(var vidIndex=0; vidIndex<$scope.videoData[value].length; vidIndex++){
if( $scope.videoData[value][vidIndex].querySelector("div") != null){
var containerId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].containerId;
videoId = LITHIUM.OOYALA.players[$scope.videoData[value][vidIndex].querySelector("div").getAttribute("id")].videoId;
/** Get the Video object */
vid = OO.Player.create(containerId,videoId);
/** Destroy the video **/
vid.destroy();
/** recreate in the same position */
var vid = OO.Player.create(containerId,videoId);
}
}
}
catch(e){
}
try{
for(var vidIndex=0; vidIndex<($scope.videoData[value].length); vidIndex++){
if($scope.videoData[value][vidIndex].querySelector('video-js') != null){
var data_id = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-video-id');
var data_account = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-account');
var data_palyer = $scope.videoData[value][vidIndex].querySelector('video-js').getAttribute('data-player');
var div = document.createElement('div');
div.id = "brightcove";
div.class = "brightcove-player";
div.innerHTML =
'(view in my videos)'
var data = div.getElementsByClassName("video-js");
var script = document.createElement('script');
script.src = "https://players.brightcove.net/" + data_account + "/" + data_palyer + "_default/index.min.js";
for(var i=0;i< data.length;i++){
videodata.push(data[i]);
}
}
}
for(var i=0;i< videodata.length;i++){
document.getElementsByClassName('lia-vid-container')[i].innerHTML = videodata[i].outerHTML;
document.body.appendChild(script);
}
}
catch(e){
}
if(!compiled){
/* Re compile html */
$compile(rootElement.querySelectorAll('div.lia-message-body-content')[0])($scope);
}
}
if (code_l.toLowerCase() != newBody.getAttribute("slang").toLowerCase()) {
/* Adding Translation flag */
var tr_obj = $filter('filter')($scope.sourceLangList, function (obj_l) {
return obj_l.code.toLowerCase() === newBody.getAttribute("slang").toLowerCase()
});
if (tr_obj.length > 0) {
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.".replace(/lilicon-trans-text/g, tr_obj[0].title);
try {
if ($scope.wootMessages[$rootScope.profLang] != undefined) {
tr_text = $scope.wootMessages[$rootScope.profLang].replace(/lilicon-trans-text/g, tr_obj[0].title);
}
} catch (e) {
}
} else {
//tr_text = "This message was translated for your convenience!";
tr_text = "Esri may utilize third parties to translate your data and/or imagery to facilitate communication across different languages.";
}
try {
if (!document.getElementById("tr-msz-" + value)) {
var tr_para = document.createElement("P");
tr_para.setAttribute("id", "tr-msz-" + value);
tr_para.setAttribute("class", "tr-msz");
tr_para.style.textAlign = 'justify';
var tr_fTag = document.createElement("IMG");
tr_fTag.setAttribute("class", "tFlag");
tr_fTag.setAttribute("src", "/html/assets/langTrFlag.PNG");
tr_fTag.style.marginRight = "5px";
tr_fTag.style.height = "14px";
tr_para.appendChild(tr_fTag);
var tr_textNode = document.createTextNode(tr_text);
tr_para.appendChild(tr_textNode);
/* Woot message only for multi source */
if(rootElement.querySelector(".lia-quilt-forum-message")){
rootElement.querySelector(".lia-quilt-forum-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-message-view-blog-topic-message")) {
rootElement.querySelector(".lia-message-view-blog-topic-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-blog-reply-message")){
rootElement.querySelector(".lia-quilt-blog-reply-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-message")){
rootElement.querySelector(".lia-quilt-tkb-message").appendChild(tr_para);
} else if(rootElement.querySelector(".lia-quilt-tkb-reply-message")){
rootElement.querySelector(".lia-quilt-tkb-reply-message").insertBefore(tr_para,rootElement.querySelector(".lia-quilt-row.lia-quilt-row-footer"));
} else if(rootElement.querySelector(".lia-quilt-idea-message")){
rootElement.querySelector(".lia-quilt-idea-message").appendChild(tr_para);
} else if(rootElement.querySelector('.lia-quilt-occasion-message')){
rootElement.querySelector('.lia-quilt-occasion-message').appendChild(tr_para);
}
else {
if (rootElement.querySelectorAll('div.lia-quilt-row-footer').length > 0) {
rootElement.querySelectorAll('div.lia-quilt-row-footer')[0].appendChild(tr_para);
} else {
rootElement.querySelectorAll('div.lia-quilt-column-message-footer')[0].appendChild(tr_para);
}
}
}
} catch (e) {
}
}
} else {
/* Do not display button for same language */
// syncList.remove(value);
var index = $scope.syncList.indexOf(value);
if (index > -1) {
$scope.syncList.splice(index, 1);
}
}
}
}
});
});
/* V 1.1:2 = Reply Sync button for multi source translation */
} catch(e){
console.log(e);
}
};
if((rContent != undefined) && (rContent != "")) {
drawCanvas(decodeURIComponent(rContent));
/** Update variable with selected language code **/
$scope.previousSelCode = code_l;
}
};
/**
* @function manageTranslation
* @description Managess the translation of given language for the thread
* @param {string} langCode - Language Code
* @param {string} tid - Thread ID
*/
$scope.manageTranslation = function (langCode, tid) {
//debugger;
$scope.showTrText = false;
/* V 2.0:5 = actualStatus variable introduced to indicate detailed connector status on UI. This variable holds the actual translation percentage */
$scope.transPercent = "";
$scope.actualStatus = "";
if (tid != "") {
var bulkTranslation = lithiumPlugin.bulkTranslation(langCode, tid);
bulkTranslation.then(function (trContent) {
if(trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, langCode);
if(langCode != "en-US") {
$scope.showTrText = true;
}
}
if((trContent.status != "NA") && trContent.status != null) {
// $scope.transPercent = String(trContent.status);
$scope.actualStatus = String(trContent.status);
} else {
// $rootScope.errorMsg = "Translation is in progress. Please check again a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
$scope.workbench = trContent.wb;
/* V 2.0:4 = Trigger uncalled or delayed callbacks (documnet uploaded/translation completed from lithium).*/
if(trContent.callback == 'true') {
var trCompletCallback = lithiumPlugin.trCompletCallback(langCode, trContent.docID);
trCompletCallback.then(function (callback){
// $rootScope.errorMsg = "Downloading Translated content in " + langCode + " now. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if (trContent.callback == 'upload') {
var trCompletUpload = lithiumPlugin.trCompletUpload(langCode, trContent.docID);
trCompletUpload.then(function (callback) {
//$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
$rootScope.errorMsg = "Uploading content to translate. Please check again in a few minutes."
});
} else if ("many" == "one") {
$scope.updateOOS();
} else if("SmartConx" == "SmartConx"){
if ("many" == "many"){
$scope.updateOOS();
}
}else if ((trContent.status != null) && trContent.status.includes("100")) {
/* If everything fine then only check Out of Sync status */
$scope.updateOOS();
} else {
/* If translation perccent is less than 100 then show the percentage on UI */
$scope.transPercent = $scope.actualStatus;
}
});
}
}
/**
* @function selectThisLang
* @description Called on select dropdown.
* @param {string} lang - Language code
*
*/
$scope.selectThisLang = function (lang, anonymousFlag) {
/* 1.4:3 Update Analytics on language selection */
try {
setTimeout(()=>{
lingoThreadLangSelected(lang, '910880');
console.log("Language",lang);
},5000)
} catch (e) {
console.log(e);
}
/** Display Translated content **/
var getTranslation = lithiumPlugin.getTranslation(lang, "910880");
getTranslation.then(function (trContent) {
if (trContent.body != "") {
$scope.showPreview(trContent.body, $scope.mszList, lang);
} else {
//$rootScope.errorMsg = "Translation is in progress. Please check again in a few minutes."
$rootScope.errorMsg = "Translation is in progress. Please retry in a few minutes."
}
});
};
var decodeEntities = (function() {
// this prevents any overhead from creating the object each time
var element = document.createElement('div');
function decodeHTMLEntities (str) {
if(str && typeof str === 'string') {
// strip script/html tags
str = str.replace(/