Hi Robert! I just upgraded to WABDE v. 2.5 and downloaded this widget this morning. I'm having an issue when trying to configure the "Update Expression" settings. When I click on the pencil to edit the expression value, nothing happens.
It looks like the search by value tab will not appear unless this is configured. Is there a bug? Or, more likely, did I do something wrong with the install?
For some reason, ArcGIS Portal 10.5.1 doesn't come with all of the jimu.js files that are present in WAB Dev edition. I had to copy CSVUtils.js from WAB Dev edition and paste it into C:\Program Files\ArcGIS\Portal\apps\webappbuilder\stemapp\jimu.js. Your eLocate widget requires ServiceBrowserRule.js and serviceBrowserRuleUtils.js, and those are missing from Portal, too.
In SingleValueEdit.js, you're creating an eSimpleTable object but the module was missing, so I added ./SimpleTable to the define and eSimpleTable to the function portion of the code. Also, I changed line 121 (now 122) from:
But after these changes, as far as I can tell from my testing, eSearch works in 10.5.1!
Edit: I now see that CSVUtils.js has to be pasted into C:\Program Files\ArcGIS\Portal\apps\webappviewer\stemapp\jimu.js as welI. As long as CSVUtils.js is in these two locations on the server hosting Portal, eSearch 2.5 works in Portal 10.5.1.
Thanks for this great Widget. I think i can (almost) skipping using the query widget. It looks like i am missing one feature, unless I just cant find it
We build an address search based on multiple fields, each with unique values specified. In the stock query widget you can set each expression to filter based on all other expressions. I.e. if the user selects house # 10, only street names with a 10 house number would show in the street name drop down. This is a very handy feature, is it or could it be in your widget somewhere?
I downloaded the latest widget this morning and am running into a problem. I went through your instruction document and configured the search by value settings, but when I test the actual widget, I am not allowed to type in the search box. I can click in it and I get a cursor, but it won't take any keyboard input. Any idea what setting I've got misconfigured that would cause that issue? My suspicion is that I've got the expression wrong:
Do I need to put anything in the text box to the right of the two drop-downs that select the field and the operator?
You need to check the Ask for values checkbox if you want the user to provide input for that field. If that is not checked then the widget assumes that you have provided a default value in the text box you are talking about.
The search field we are using contains nulls and empty string values, however when we configured the widget to "Hide Null data in widget results and popups" there are some that still show up in the drop-down list.
The Expression set to "is" with the "Unique" property.
Hi there, apologies as I messaged you but probably better to ask a question on here...
I have got the enhance search widget into a test app and have configured searches but when i go to use the widget in the app this is as far as I get with the following error message can you offer any insight?
That is not a null value, it is an blank string. So it will not be filtered out. Also the removal of null happens in the widgets results and popup not the unique drop down list. So the answer is yes, it is expected.
Yes to portal, I noted a previous comment stating "For some reason, ArcGIS Portal 10.5.1 doesn't come with all of the jimu.js files that are present in WAB Dev edition. I had to copy CSVUtils.js from WAB Dev edition and paste it into C:\Program Files\ArcGIS\Portal\apps\webappbuilder\stemapp\jimu.js." My error message seems to refer to the same file...
I am not sure why Portal 10.5.1 did not have the CSVUtils.js on your end as that portal version should be the same as WAB 2.4 and that file is still there in 2.4 and 2.5. It is hard for me to say what the issue is as I do not have Portal 10.5.1. installed.
Yes, to get eSearch to work in Portal 10.5.1 I had to copy CSVUtils.js from WAB and paste it into Portal's webappbuilder and webappviewer folders. Once you do that, it should work correctly.
I'm not sure why the Portal team chose to leave out so many files from the jimu.js folder. Disregarding the files within subfolders, WAB has dozens, but there's only one file in Portal.
So the issue is that you have an OBJECTID field that has a type of esriFieldTypeIntegerinstead of the normal type of esriFieldTypeOID so the eSearch is trying to add the ObjectId field to the query and it is not finding a field with the type esriFieldTypeOID and thus it is adding a null. I will work on trapping this error, but you need to look at your layer schema as this is NOT normal.
Also if you use the older versions link to get the latest 2.4 version (2.4.1.1) it is compatible with portal without any code adjustments (and now has the fix for the ObjectId issue you are seeing).
For some reason with our portal i have to modify any paths in custom widgets that are ./ or ../ to be a hardcoded fully qualified path (https://www.mymanatee.org/gisapps/widgets/....filename.js') I have no idea why, otherwise it tries to pull the js file from within portal and appends a wab?v2.4 or something to the end
Thanks for the quick fix. Sorry to be a pain, but i had already upgraded to 2.5 to see if that was the problem. Can you tell me what file(s) the fix is in so i can merge the changes?
Version 2.5 will already have the Portal fixes (removal of eSearch widget hardcoded paths) in it it is just the ObjectID fix that has not been added.
When using Portal you should use the previous version of widgets (Portal 10.5.1 needs to use 2.4 versions). I the custom widget happens to use a new dijit or core feature of the latest version of WAB then Portal with is the previous version will break.
When you run eSearch 2.4 to find a parcel, you get a list of nicely formatted hyperlinks.
The Popup Panel shows the complete list of parcel attributes with their user defined alias names.
This is great.
However, when I copy over the exact same config_eSearch.json file and place it within WAB 2.5 (eSearch 2.5), the formatting of the hyperlinks gets messed up like this.
I was expected to see the alias names for all the items.
For example, I was expecting to see “Parcel Number” rather than the item name APNDash.
When I open the Popup Panel, I see that none of the attributes are showing their user defined alias names.
They are all showing the Item Names.
When I open the configuration panel for the Identify 2.5 widget in WAB 2.5, I see it did not read the user defined alias names. They are all pointing to the item names.
I also found an extra “undefined” column that shows up as an artifact.
So to troubleshoot, I examined the original config_Identify.json file for 2.4.
There were 3 components to each item:
name
alias
useralias
For example, useralias = Parcel Number
When I compared this to the config_Identify.json file for 2.5, I saw that there were only two components to each item:
name
alias
The useralias was missing.
When I tried to enter the User Alias value for the Alias value, it turned up with a blank value.
For example:
name = APNDash
alias = Parcel Number
The Alias name did show up, but the value was blank.
I may be doing something wrong which is causing these issues.
Once again, thank you so much for taking your time to update these custom widgets with every new release of the Web AppBuilder.
Your Enhanced Search Widget has gone through 71 updates! This is incredible.
The eSearch and Identify Widgets are the two essential custom widgets that go into all our Web Apps.
With all the effort you have put in to maintain and update these two critical tools, I feel ESRI should simply incorporate them into their standard Widget Pool. This will be welcomed by the Web AppBuilder Community.
Thanks to your incredible Enhanced Search Widget and Identify Widget, our users can instantly get to a parcel out of a File Geodatabase of 1.6 million records, with over 70 parcel attributes and hyperlinks.
It just works like magic.
These are amazingly powerful web apps that anyone can deploy without having to write a single line of code!
Thanks to Moxie Zhang and his team for Web AppBuilder 2.5.
Thank you for the eSearch 2.5 version. When I read about the ability to hide null field values from the results and popups, I was hoping the users will not be able to select the NULL values but I don't think I understood it this correctly. See the image attached. Could you please explain what this new feature does? Thank you,
I was just curious to know if I set the configuration to use "popups from the web map" and I don't enable/configure the popup in the web map itself, does the eSearch widget automatically use the eSearch popup?
I'm having a weird issue and I'm hoping you might be able to help me out. We've been using the eSearch for more than a year now and it has worked flawlessly the entire time. Our 2.4 Web App is using eSearch Version 2.3. Early last week, the Search by Value ceased working as it had and started returning no results. This search for Survey numbers containing "CS1" should return hundreds of results.
The query it sends to the service should be
Upper(DocumentNa) LIKE Upper('%cs1%')
but instead it is sending the entire query regardless of the entered parameters.
Upper(DocumentNa) LIKE Upper('%cs1%') AND Upper(SurveyorKe) LIKE Upper('%%') AND Upper(Subdivisio) LIKE Upper('%%') AND Upper(ClerkNumbe) LIKE Upper('%%')
The issue exists in IE, Firefox, and Chrome versions 59 and 60. No errors show in the DEV Console.
Any guidance you might have would be highly appreciated.
I haven't made any changes to the app since early July and the data structure has remained unchanged as well. I'm a little baffled here. The only change I've made is updating our server to 10.5.1
';
}
}
}
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(/