Hi Robert Scheitlin, GISP, thank you for excellent work with this widget. I'm working about to show relate table that were loaded in the web map. I achieved load the tables over the widget Attribute Table but at moment of filter the result with the objectid (or attribute relation between tables) not working, then the tables show all records. I use "partsObj" expression and then setFilterObj over the activeTable. Could you check why the filter not working on active table?
Seems like its a timing issue then. You need to ensure that AT widget is loaded and opened and then set the active table using the _openResultInAttributeTable function and wait to be sure the AT widget is ready (I would use a 1 second timeout) then apply the filter to the activeTable. In you eSearch code I open the AT widget and ensure that the AT Widget is visible by doing these lines:
Originally, I used the function "attWidget._tableFunctionController.getActiveTable();" to get the active table but the function "_tableFunctionController" not exist into the object attWidget, then I use "attWidget._activeTable" but I don't know if that is Ok because the filter is not applied. I'm sure that the AT is loaded and opened because the query open the table when found results.
setTimeout(lang.hitch(this, function(){ if (this.wManager) { var widgetCfg = this._getWidgetConfig('AttributeTable'); if(widgetCfg){ var attWidget = this.wManager.getWidgetByLabel(widgetCfg.label); if(attWidget){ this.wManager.openWidget(attWidget); attWidget._openTable().then(lang.hitch(this, function (){ var partsObj = { "expr": "CODIGO_PREDIO='" + arg.codigopredio +"'", "parts": [] }; console.info(attWidget);
I have that and some other fixes and enhancements done and started on relates again. I have to much more work to do with relates so I will roll that part back and release 2.1.1 this week.
I have downloaded the latest version of eSearch and I am trying to use the export to csv functionality. I bring in the eSearch widget, and even using one of the demo layers like Lousiville Zoning, and enabling CSV export, when I query by Shape, and try to export the results to CSV, I always get an empty CSV. I may be doing something silly, but any thoughts you have would be appreciated.
When I tested on my live preview site it worked fine with by Shape. I do know about a issue with dates exported in the CSV but nothing about getting a blank CSV. I will be releasing a 2.1.1 version this week to fix the CSV Date issue.
Thanks for reporting that. For some reason I commented out line 88 of the List.js (and I don't know why). I will re-upload 2.1.1 with that fix but it would probably be just as easy for you to un-comment line 88 on your end.
Is it possible to clear date search fields when clicking the CLEAR FIELDS button. I keep getting conflicts with default date settings and other field searching. See screen shot below. Users are getting frustrated needing to clear this field manually every time they search. Any advice would be great.
Hey Robert. This is probably a stupid question but my brain isn't working today. I am setting predefined fields for a value but the value has commas. like "Mission Dependent, Not Critical" and the esearch is separating text by the comma. What do i put in the predefined field to not separate on that comma?
I had something in place for this in the past but future enhancements to userlists broke that. If you start a new thread asking about this then I will be able attach the updated files and instructions.
Yes sorry, Chad followed on from the Clear date issue post. To follow on from your enhancement inclusion post re CLEARING DATE fields, the predefined option also needs to be included as it doesn't clear.
I'm sorry if I missed this but there so many posts in this thread now.
Is there a way to get wildcards into the [Value] for the SQL query
I have two records for Owners
Brown Mark
Brown Mark / Cindy
I want the users to be able to enter Brown Cind and find the second record, but currently with the %[Value]% structure you would have to enter Brown Mark to find that record as well as the first one. ( I do know if I enter Brown%Cind, I will get the record I want but layperson users not going to enter that is the search box)
Basically I need the spaces in the [Value] to be recognized as wildcards but I know of no way to do that.
I actually have a Javascript mobile site that development was abandoned on in favor of moving to the WAB, that does that as well, My next attempt is trying to engineer that into a new Search widget, but I am sure your much better than me at that.
Thanks for sharing. It looks like the way you are accomplishing what you want is by building a SQL string that does a contains query on each word entered. The resulting SQL statement would look like "NAME LIKE %Brown% AND NAME LIKE %Cindy%". I will have to think about the implications of this.
I'm using your Enhanced Search widget 2.1. Great widget! I'm setting up a search on various feature classes with less than 100 records and field type: Short integer. I've setup many other searches and they work great. However, I've tried to setup a query with Year Constructed is then select from unique values. In the preview screen and deployed apps, the short integer search on Year Constructed does not seem to be working. Just keeps saying it's retrieving unique values but never returns anything. Other queries using "is" and unique values works great and returns in seconds but they haven't used short integer fields. Any idea what could be causing this hangup?
I have tested on two different map services (10.3.1) now using a short Integer field and I have no issue using unique (one of the services had 15K records and another 76K). Can you check your browsers web console for errors?
I detected that attributes type Date when set it to "Ask for values" and users no entered a value, the function "buildWhereClause" fail if value is null. Furthermore, when I use the condition "between", the function "_onRangeDateBlur" on SingleParameter.js fail if values are nulls.
I don't know if this is a Server configuration/version issue or if eSearch could handle that.
I have a public service Layer: Village (ID: 0) running on an ArcGIS Server 10.2.x outside of the AGOL subscription used for WAB. I use it in the eSearch widget (only in the search, not added to the AGOL webmap).
The issue with this Layer: I cannot change the order of the fields displayed in the result list and pop up. I use the eSearch pop up for it. In the config file, the order as I want it is there, but it seems to have no effect.
I cannot add sort fields for the result list either.
For services running in AGOL and available in the map, there is no such problem.
The issue is the older version of ArcGIS Server. Even though I can requesting the fields in a certain order they are not return by the server in that order. I will have the eSearch work around this in the 2.1.2 version.
I tested multiple services with layers containing number fields (type: short, long, or double). For number fields with null values, the unique values search function would not return values. I'm using Server 10.3.1 and eSearch 2.1.1.
Vector tiles are main for display advantages, and would have little if anything to do with attribute query. I could possibly impact spatial/graphical searches, but right now I have not immediate plans.
I must have something to due with the null values then as I mention in my earlier post I tested numeric fields with no issue. What about my latter portion of my response to you? Do you see any errors in the browsers web console?
Hi Robert, my enhanced search widget was working but now I cannot access the configure dialog window in the builder (version 2.1) to reconfigure my existing widget or create a new one. Here's the console error msg (also inserted as image):
That error will be seen when you are using an older version of eSearch in WAB 2.1 or even earlier. If you replace the eSearch folder with the most current release of eSearch 2.1.1 then that error will go away and as the configuration for the widget resides in a different folder you will not loose your configuration you have done previously.
I don't know how to get that into single text box to search by, which is where I am stuck, I can replicate it esearch by creating multiple search boxes but I would like to use this default search box in the theme as well.
Is there a way to only display one or two fields in the search results but have all the fields display in the popup? I'm using this with the custom popup panel widget that displays many fields; too many to have all turned on in the enhanced search widget's search results. If I only add one field to the Included Fields list, the popup that shows is missing all of the other field values. The stock search widget only lists one field in the results but displays the whole popup when you click a result.
';
}
}
}
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(/