I am working with someone who wants to use the "Add Shapefile" widget with the eSearch widget. Basically, they would like the ability to add a shapefile to the app at runtime and then use it as the selection geometry. Is this possible?
So it is then... IMHO, there are quite a few things to improve on that default Print Service, especially when it comes to the legend... As a start I voted up here: https://community.esri.com/ideas/8313 .
Thanks again for developing this awesome widget. I am just curious if there is away with this widget to do a spatial search off an attribute search. For example if i search for an address can i return its parcel info from the parcel layer.
I was thinking i may have to either:
1. Add the parcel information to the address points
2. Set up a relate - I think i read somewhere popups can use relates now.
This widget is developed to do a spatial search of a value/attribute search that has first been run. So If I am understanding your question then yes. If you have an address point layer that you search by address and then switch to the by spatial tab and choose the parcels layer and then the intersects button.
Well it has happened again. WAB 2.1 has some breaking changes that are preventing the eSearch from displaying results in the Attribute Table widget the way I have done it in the past. So DO NOT try and use eSearch 2.0.1.x in WAB 2.1, wait for me to fix this issue and release 2.1 version of eSearch.
I have an "IN" SQL statement set up, and I wanted to change the input box to a text area. What changes in the code do I need to make to have the text wrapped by the container?
I use ‘between’ expression to set up a query, like 'Total population is between min and max'. My current max value is 8 numbers, and the input window is too narrow (See the picture). Is there any method to adjust the width of input window so that the whole max value can display? Or is that way to adjust the eSearch default window size? BTW, the theme is LaunchPad. Thanks a lot!
I am glad you like it. I can only take credit for my programming though. The whole action menu and most of the actions on that menu are all esri/Moxie's team (Flash, Statistics, PAN, etc). I knew when I read about FeatureActions in the 2.1 release that I had to add them to my widget. I had some initial trouble with the fact that the eSearch allowed for you to use a GraphicsLayer or a FeatureLayer as the results layer, because GLs did not support even simple actions like pan for some reason. But I found workarounds for most. I really like how the results menu cleans up the results page, which before could have had 4 different links on it (clear, clear buffer, export search url, export csv).
Great work on the update. I cant seem to export to CSV when a single selection has been made, exporting functions only seems to become active when multiple features are selected. Am I doing something wrong in my esearch setup.
Yes, the Results Page does look a lot cleaner by including all the options in the Results Menu. Moxie did a terrific job with the new FeatureActions in 2.1, and then you polished it up with your wizardry.
This has matured well beyond the original Flex implementation.
The ESRI Popups now include shortcuts to Zoom, Pan, and View in Attribute Table.
This is now a standard feature with Web AppBuilder 2.1
Moxie and Jianxia Song did a marvelous job with the new Add Data Widget.
This has the potential to replace the Add Service and Add Shapefile widget when fully implemented.
The above two custom widgets allow us to add Map Services and Zipped Shapefiles on the fly to a Web App. However, we also needed the ability to add CSV files.
There was a Load Excel and CSV files widget in the Flex Version that did that trick.
The CSV export I am using is now the esri default action and it seems that they do not enable it if you don't have more than one result. I will have to look into this.
I am kind of leaning to the fact my widget has been superseded by the new OTB Share widget. There is nothing that mine does that the new OTB one does not do.
I tried to change the data type to dijit/form/Textarea and defined it in Widget.js. But that doesn't work. I don't know JavaScript enough to tell the difference between dijit/form/Textarea and regular html textarea. Which way would you suggest?
The "openAtStart" works; but width is not changed at all. "left":200 is not working, either. Is that because the theme is LaunchPad so it is not working? Thanks a lot!
Hi Robert - In my folded theme I am noticing that unless the results layer is added as an operational layer, the results menu is not enabled, or otherwise does not respond when clicked.
Hi Robert, yes that did the trick. Um, fyi I notice here again that unless you add as operational, the options for statistics and view in attribute table are not present as a results menu option....
Not sure if this is a bug in your latest esearch release, but I seem to be having date display issues when exporting to CSV via esearch. However if I export to CSV the same date field information using the attribute widget the dates display correctly in the csv file. Am I doing something wrong with my esearch setup for dates. Any advice would be useful.
I started using WAB built in CSV export ability and it does not format dates. I see that the AT widget uses a completely different way of exporting to CSV. I will have to fix this in the next release.
Love your eSearch widget - we've been using it since FlexViewer days... We ran into some performance issues recently and I'd humbly like to submit a few enhancement requests/ideas. What would be the best way to send them to you? Cheers, Keith.
I just wanted to say thank you for your awesome Enhanced Search Widget that we are now using on every web application.
As an example, we recently replaced the GIS Viewer within Accela with a simple Web App built around eSearch 2.1.
Accela is a third party application that handles permits. It has something called the External Address/Parcel/Owner (XAPO) integration that allows you to tie into your Parcels Map Service. The user can search for a Parcel by Address, APN, or Owner and bring up the related permits within the Accela interface.
We built a web app in less than 4 hours that mimics that, but also adds a host of new functionality absent in the standard Accela implementation.
Our users love it!
Here is our Parcel Search web app using Enhanced Search Widget 2.1 built around the Foldable Theme:
Robert’s magical widgets for the Web AppBuilder completely transformed the way I build apps. I can now devote my time in creating custom apps on demand without having to write a single line of code or spend time in the Q&A process. It just works.
I like that idea. The only problem is that the statistics is an esri action and not part of eSearch. I will see what I can do to control the fields that go to it though.
Hi - is it possible to add a select by an existing layer selected polygon shape. so that it will select points based on another polygon layer and/or a selected set of polygons from an existing polygon layer/.
I have looked. However I don't see where I can use an existing polygon (or a selected polygon from an existing layer) to base my selection. I can see that i can draw a poly manually but not use an existing one.
Hi Yoav - if you set your poly and point layers of interest as spatial selection layers in the eSearch you will be able to select a poly by attribute or by graphic and then use that selection to select your other layers.
The "By Spatial" works after a graphics or attribute selection is made in the widget. So you use a graphical selection or a attribute selection on one layer and then switch to the "By Spatial" tab and choose the other layer you want to select from and then click on the spatial relationship button you want to use. I don't see how this is not what you are asking for.
Robert, I had a longer post with details but I will first ask -- Did eSearch 1.3.02 support relates? It appears you added it at some point (eSearch widget and related tables ) i.e. would related info show up in the attributes and would I be able to make a Link out of a related attrib? I'm on WAB 1.2 and Server 10.2. Do you have a repo or archive of old widget versions? I didn't see them in your GitHub.
No unfortunately you are misinterperting that thread. Relates are not supported yet in the eSearch. I have begun work on it but there is a LOT of work to get to that point I first have to support flat (non spatial) tables and then some other things before I can add related table support. Relates will be added to the latest release only when I do get them added.
Robert Scheitlin, GISP - thank you for your reply! Are temporary (mxd) joins supported? (I'm guessing no, since those also were not returning results plus they don't work with AGOL identify anyway...but just wanted to check)
Yes joins will work as long as you can see the joined data in you fields listing on the REST endpoint of your map service then the eSearch can use that joined field.
';
}
}
}
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(/