Is there any chance you can give me some pointers here... and possibly consider a modification to the interface in a future release?
I've received a couple requests from our staff over the last few months to update how the 'By Spatial' tab appears. They would like to know if it's possible to move the 'Apply Buffer' button below the input buffer distance box. I think some of the users are mistaking it simply for an image, or just don't know that you enter the distance first, then the button. In essence, it would look like 'Search entities of' area. Also, would it be possible add numbers before each item to help give the user an idea of the full progression? For example:
I have no idea how much work this would entail or if it will mess up something else in your setup but I just want to see if it's possible. If it's not something you'd want to modify, and if you have tips for how to accomplish it, I'd be glad to try them.
The error is a simple fix if you want to correct this before I release the next version:,In the Widget.js postCreate function find the line 175(this._initDrawBox();) and cut it from there and then add a new line above line 170 (this._initTabContainer();) and paste it there. That is it you are now good to go.
Thanks, Robert. I might go ahead and try it myself and see what I can come up with and avoid messing up something else.
I also have a Help doc for our entire site that includes steps for eSearch buffering and either people don't use it or don't know it's there. Looks like I need to do a better job of notifying them of both Help docs.
Ok I think I have determined its an issue in the new 2.4 that is my problem if you go to my old site and Select Point then click back to the Value tab in ESearch you can still click on parcels in the map and get results from the By Shape Point
In the new 2.4 version of your app I do not see the code change I suggested above made to the esearch widget. So naturally it would still have the issue.
I guess I being misleading, and this is another issue, I solved the By Shape and Point setting issue with your original code but I was requested by users to make it work like the old site with the Attribute Tab active and the Point selected so they could search for a parcel, then click on the surrounding ones to get information. I didn't realize it didn't work the same until after the By Shape and Point(cause with 2.12. I can't have the point selected as default), I was going to make that default but users wanted the By Value to be first thing they see.
Yes, and No the functionality I want exists in the old site 2.1.2 but you have to activate the Point before you can click around(so you can find new parcels even while on Value and Results Tab ie I can just click around the make while on the Results tab and get new parcel records), I was just trying to get Point active as soon as the site loads, but in 2.4 it seems to work differently and its only be active when on the By Shape Tab.
James, that was actually a bug that got fixed in a latter release. Some people were complaining that the drawing tool was active even though they were not on the by shape tab (exactly what you are wanting).
The change to make to allow what you are after is in the Widget.js > _initTabContainer function:
//The way the code looks in eSearch 2.4if(initView ==="text"&&this.attribTab){this.selTab =this.nls.selectByAttribute;}elseif(initView ==="graphical"&&this.shapeTab){this.selTab =this.nls.selectFeatures;if(this.autoactivatedtool){this.drawBox.activate(this.autoactivatedtool.toUpperCase());}}//The way it needs to looks for youif(initView ==="text"&&this.attribTab){this.selTab =this.nls.selectByAttribute;}elseif(initView ==="graphical"&&this.shapeTab){this.selTab =this.nls.selectFeatures;}if(this.autoactivatedtool){this.drawBox.activate(this.autoactivatedtool.toUpperCase());}
OK that solved my original issue of the site loading on the Value Tab but having the Point enabled on the By Shape and just clicking on the map, that works wonderfully now. But after I get the results I can't select another parcel without going back to the Shape Tab I seem to be missing something?
this.keepgraphicalsearchenabled = this.config.graphicalsearchoptions.keepgraphicalsearchenabled || true; ?? actually was the very first thing I tried before posting again.
I am having a minor issue when using Google Chrome with the widget. I am using version 2.3 of the widget and was able to reproduce the issue on 2.4 as well. Basically when I first launch the application and perform a search using chrome and click on the Results menu button after getting search results, some of the menu items look garbled as shown in the picture. If I click on the menu second time, it looks normal. It looks normal for the entire session no matter how many times I use the widget. It reappears when I start a new session or refresh the browser. I am using the latest version of chrome browser. This issue has not appeared in any other browsers. I used Search By Value. It also does not appear when the widget is not a header controller widget.
Thanks for the speedy reply. The garbled problem has been solved with the new css rule. However, It is cutting off the last few characters of View in Attribute Table menu item. See screenshot below.
Correct the real problem is in the popup menu class that is out of the control of my widget (WAB core). It seems that it is not calculating the menus width properly the first time it is shown but subsequent shows do calculate correctly.
Quick Question. I have a couple users telling me they cannot see the text input box in the latest version of the eSearch tool... have you run into this before. I've done the typical trouble shooting of having them clear their browser cache and checking all ports. I'm wondering if their organization is blocking something that the tool needs for rendering the widget. Thoughts?
I have not been able to replicate this problem. It works fine on phones and every other external device that I have tried.
One more question. This is something I noticed with the upgrade. We moved from WAB 2.1 to 2.4 so I rebuilt the eSearch tool. Anyways, when I search for 1100 N Atherton St in our buildings data I get multiple results... 1100 N Atherton St and 1100 S Atherton St. Any ideas here? I clearly enter N and not S, and the value would be 1100 N Atherton St. I am using the "LIKE" operator in the query
So I think I figured it out. For some reason in WAB 2.1 when I used the operator contains it didn't give me the same results. It appears that now I need to use Starts with to get the same results as before. A little strange given the code between the two versions is the same.
In any case, that solved my problems for the search.
I also narrowed down the text box not showing up to the end users network restricting something...still not sure what it is blocking.
Here is what I have found. In the 2.1 version of the eSearch widget I used CONTAINS as the operator with this expression... "Upper(ADDRESS) LIKE Upper('%[value]%')"
Now with the 2.4 version of the tool it appears I need to change the operator to StartsWith and then use this expression "Upper(ADDRESS) LIKE Upper('%[value]%')" to get the same behavior. I'm guessing something changed slightly in the coding.
I was able to work around it...but wanted you to know. Here is an simple example of what I was seeing.
I would search for 1100 N ATHERTON ST and my results would be...
1100 N ATHERTON ST
1100 S ATHERTON ST
Using the StartsWith and the same equation I get just 1100 N ATHERTON ST... which is what I would expect.
I'm sorry... I must have confused you a little. You care correct in the way it formats the different queries. What I was getting at was in 2.1 I used contains and it behaved in a certain manor. In the 2.4WAB / Widget it behaved differently. My fix for the problem was to use the starts with operator and the contains query. I had to change it in the code. For some reason the contains produced strange results. When I used starts with and the contains query it behaved like it did in 2.1
I was wondering if it is possible to disable displaying the Search Layer dropdown arrow button and dropdown menu when there is only one search layer configured in the eSearch widget, Basically it would be helpful for our end users if they could just see the static box with the search layer name faded without the dropdown menu just like the font style used in the "Tax ID is" heading. Thank You.
I ran into the same issue as Anish with the text being messed up on the eSearch results menu. Thankfully I remembered it being mentioned here and I'm going to apply the fix you already posted. Just in case it's useful information, I wanted to point out that I noticed the font in this menu is different between 2.1 and 2.4, with 2.4 using a font that is a bit wider.
I was looking for almost the same like Anish. I only have one search layer and only one Search Expression defined so there is no need to display the select field for the search layer. I tried just to remove it from the Widget.html but I guess then it is still looking for the "result" from the select field and can't find it. Do you have a hint for me how to accomplish what I need?
';
}
}
}
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(/