Are you not presented with the Identify Manager login dialog when you put that secured url in the eSearch layer dialog? When I test in WAB Dev and add a secure layer url I am presented with the login and when I provide my credentials the layer is added fine. The proxy will be used once the app is deployed (I.e. you are not running it in WAB Dev).
Really it's a great work. thank you guys for making our lives much easier.
I have a question: I have a field that is bound to a domain, and looks like the domain value has a trailing space at its end, like "Existing ", and the problem is when searching by an expression that uses this field it seems that it searches for the trimmed value "Existing" rather than "Existing " which gives no results. Appreciate your support
Well that is extremely unusual to have a field name with a trailing space that is why I have code in the widget to trim field names to prevent someone from manually configuring a field and accidentally adding a trailing space. Can you not modify your data as you schema of having a trailing space it very unusual?
Is it possible to have a checkbox functionality with the widget? I have a field with True/False (1/0) values and using the dropdown "Unique values" or "Predefined values" functionality does not seems to be the best... Thank you in advance!
Any chance you could add a word wrap control into the results display. Currently you need to use the scroll arrow. It would make the results display more user friendly.
I have a layer that I do not want turned on when the map starts. However, I want to be able to search this layer. It's a bit confusing because if you search by this layer and it isn't turned on then the search highlights that feature, but the layer isn't turned on.
Is there a way to turn on a layer on by default when you search by that layer?
I am trying to tweak a departed co-worker's web app that uses the Enhanced Search widget. I am new to this and am trying to figure out if there is a way to make the drop-down for the field values a multiselect? If not, I guess we could use the Add to Selection query option instead? Thanks for your help!
The eSearch does not need the layer to be visible or even added to the map at all. The way the eSearch works is it uses a QueryTask and get the results and their geometry to add as a new layer to the map.
This widget looks very useful and powerful! I tried to use it in an app that I am creating but I get an error "search failed" when I use the option 'By shape' and I draw a shape (in my case a point with buffer or a circle). I've tried to look among all the messages here in order to find a solution but I don't get it.
I also tried the demo version and I also get the "search failed" message, but at least I can see the circle drawn.
I was having a problem with my Proxy on my preview site. It is now fixed though. Try the preview site again. Because buffering can produce large server requests they need to use POST and thus a proxy is required.
now I am able to use the preview demo and look how it works. thanks. I followed the instructions here detailed http://www.tapasdas.com/WABv2.pdf on how to set up a proxy but I still get the same message search failed. any indication?
Can you please resolve the "Title" name located under the "Search URL" from defaulting back to its original name each time you go in and make any changes to the widgets config. Not urgent just annoying.
thanks for your response. I have one more question. Can I change field Title or this field must be named by default. Because I can change this field and save it but this field is changed to default in next editing of Search Layer.
If you are talking about the field alias the you just have to double click the alias name in the table to enable editing it. If you are talking about the title field the radio button in the fields table, I just tested and it does change to what you set it to and will remain there as long as you save your changes. Let me know if I am not understanding your question.
I am using the following setup and getting the error "create widget error widgets/eSearch/Widget" when trying to open the Enhanced Search Widget:
Enhanced Search Widget v 1.2.0.6
Developer WAB version 1.2 - Locally
Why am I getting this code?
@
Below is what the console says in Google Chrome:
I am very new to this WAB stuff, but need to get it working. I've been following Tapas Das's instructions for setup because it was the only 'how-to' I could find and it is very helpful.
Jordan Behunin do you have ESRI support? If you do, I think the quickest thing for you would be to just call them and ask to talk to someone on the WebApp Builder Team. (they have one for WAB now) They can do a Screen share to see your screen and even take control of it. If you have never called in... they are excellent. Worth every penny. Ask to speak to Sakshi if you can. She is highly skilled on JS API and WAB. I don't know how new you are to JS and dev in general or to WAB but if you are new to them all...they'll point you in the right direction(s).
Per your recommendation I just did. It doesn't give me the error when using any of the other widgets. As Kevin mentioned in the next post, it may be good to hop on tech support.
So if the error went away when you remove the eSearch then that points to a issue in your eSearch configuration/installation. Can you detail how you added the eSearch to your app?
Ah, Robert is right.. they are often reluctant to get in to custom coding, of course. But I did not know if Jordan was new to web dev or the API in general. If that is the case, Custom WAB is several layers deeper in the onion (yes a Shrek reference). I'll sit back down now in class... I just wanted to put in a plug for esri Tech Support, they were helpful when I was just beginning learning Javascript and the API. And I imagine the WAB team would not mind helping users to learn how to add a new widget, whether custom or ESRI, just to cover the basics.
Per Tapas Das's instructions. Simplified explanation - downloaded your app from this forum, extracted and added it to my C:\WAB\client\stemapp\widgets\eSearch, registered my app with online, started WAB locally with 'startup.bat' and gave Online my credentials, created the map, added the eSearch widget and configured it to search.
I think I'm going to redownload the eSearch and readd and configure the widget again.
I have a few more questions for you and I apologize if they've been covered before.
1) Is there an option in the config to set a maximum buffer distance? I don't know that we need a max distance, but I'm curious to know if than can be set.
2) When buffering a graphic is it possible to leave visible the graphic around which the buffer was created? For example, in the image below the blue is a 50' buffer around the point I selected. I would like to have that original point (or any other graphic I draw) remain visible. Is that an option?
3) Your Identify widget has the option to "Remove Result" from the Results tab (). Is it possible to have that in eSearch too? I know you have the option available on the "By Value" tab, but I'm wondering if it is possible to have available on the "Results" tab.
I am sure I'll have more questions for this widget and your other widgets down the road. We currently are using the eSearch, Identify, eLocate widgets and may add the eBasemap Gallery widget to our application soon. Our users find all of them extremely helpful and easy to use. I would also like to send a big "thanks" again for all of your work and time helping the rest of us.
No there is currently no option for this, but I like the idea and will add it to the enhancements list.
Not sure I like the idea of leaving the drawn graphic on the map. That would clutter the map with the drawn graphic, the buffer graphic, and the results graphic...
I had though about adding this before and likely will for the next release.
2) I understand what you mean. If it's something that could be worked in later (I don't know much more code that requires, let alone what changes would have to be made to the UI) but that option might be useful.
Ok so what am I doing wrong. I downloaded the esearch zip file from the link on the main part, unzipped it and placed it with the other widgets. I do not get the newer 1.2.0.6 functionality. I do not get the clear on the "By Value" nor do I get any options to configure a layer symbology. Suggestions?
If you are adding the new version to an existing app then you have to place the new eSearch folder in that apps widgets folder and not the stemapps widgets folder
I added the new version to the web app builder developer at the in stemapps widget folder level. I have not attempted to update an existing app yet. I was just going to make a new app for a new project, and say that I do not get that functionality.
';
}
}
}
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 {
lingoThreadLangSelected(lang, '910880');
} catch (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(/