POST
|
Hello, I'm trying to use a format like the one used in Robert Scheitlin's Enhanced Search Widget where the main widget (widget.js) calls a function from a secondary file (List.js) to add content to the widget. Below are abbreviated versions of what my widget.js, List.js and widget.html look like. Widget.js define([
//...
'./List',
//...
],function(
//...
List,
//...
) {
return declare([BaseWidget, _WidgetsInTemplateMixin], {
//...
list: null,
//...
startup: function() {
this.inherited(arguments);
//console.log('RatioQuery::startup');
this.list.parentWidget = this;
},
//...
_onSuccessfulQueryCompletion: function(results) {
console.log('RatioQuery::_onSuccessfulQueryCompletion');
//...
this.list.add = ({
accountNbr: accountNbr,
addressLine1: addressLine1,
grantor: grantor,
grantee: grantee,
saleDate: saleDate,
salePrice: salePrice
});
//...
},
//...
});
}); List.js define([
'dojo/_base/declare',
'dijit/_WidgetBase',
'dojo/_base/lang',
'dojox/gfx',
'dojo/on',
'dojo/dom-construct',
'dojo/dom-attr',
'dojo/_base/array',
'dojo/dom',
'dojo/query',
'dojo/dom-class',
'dojo/dom-style',
'dojo/Evented',
'esri/symbols/jsonUtils'
],
function(
declare,
_WidgetBase,
lang,
gfx,
on,
domConstruct,
domAttr,
array,
dom,
query,
domClass,
domStyle,
Evented,
jsonUtils
) {
return declare([_WidgetBase, Evented], {
'class': 'widgets-ratio-query-list',
parentWidget: null,
startup: function() {
console.log("RatioQuery::List::startup");
this.items = [];
this._listContainer = domConstruct.create("div");
domConstruct.place(this._listContainer, this.domNode);
},
add: function(item) {
console.log("RatioQuery::List::add");
if (arguments.length === 0) {
return;
}
this.items.push(item);
//console.info(this.items);
var div = domConstruct.create("div");
var parcelRecord = domConstruct.create("p");
parcelRecord.textContent = parcelRecord.innerText = "Account No: " + item.accountNbr + "Address: " + item.addressLine1 + "Grantor: " + item.grantor + "Grantee: " + item.grantee + "Sale Date: " + item.saleDate + "Sale Price: " + item.salePrice;
domConstruct.place(parcelRecord, div);
domConstruct.place(div, this._listContainer);
this.clearSelection();
}
});
}); Widget.html <div data-dojo-type="widgets/ratioQuery/List" data-dojo-attach-point="list" style="width:100%;clear:both;">
</div> I don't know why it's not working. Any help is greatly appreciated. Thank you. William
... View more
02-15-2017
06:52 AM
|
0
|
6
|
1793
|
POST
|
Hi Robert, Thank you. This is similar to an example I found on Code Project. Two questions for clarification: Both have a console application for using the Rest service. I don't need that. I will include similar code in the Web AppBuilder widget to use the Rest service, correct? So, for the Rest service created using WCF, I should focus on the IService (interface), the Service (class implementing the interface), the webconfig and, according to the Code Project example, an ASAX, right? William
... View more
02-10-2017
12:34 PM
|
0
|
17
|
642
|
POST
|
Hi Robert, I would definitely go that route, but I only have access to Visual Studio 2010 where I work. Most of the tutorials/examples require 2012 or newer. William
... View more
02-10-2017
11:23 AM
|
0
|
20
|
642
|
POST
|
Hi Drew, I think I'll have to write a web service due to the one to many relationship of the data. Thank you for all your help though. I learned a lot! William
... View more
02-10-2017
09:11 AM
|
0
|
1
|
920
|
POST
|
Hi Robert, Did you use WCF, MVC or something else to create your web services? Thank you. William
... View more
02-10-2017
09:02 AM
|
0
|
24
|
892
|
POST
|
Hi Robert, Unfortunately this solution won't work as the view of the two tables has multiple records for each account number (one of the tables is of property sales) and ArcMap's join only adds one of the records. At least that's what I'm told will happen. William
... View more
02-09-2017
12:11 PM
|
0
|
0
|
1772
|
POST
|
Hi Drew, Here are some more details: The database is SQL. The two tables are in the same database. I don't know. The GIS director performed the operation. (I know very little about ArcMap, as I have never really had a chance to use it.) This is being done on our ArcGIS Server. The first time it was attempted, ArcMap just closed. The second time, I didn't have time to read the message on the screen. The view of the two tables was published as a map service with a random layer, as it would not publish without a layer. I had shown the director your instructions on how to publish the table as a map document, but was told it needed to be a map service in order for me to access it. William
... View more
02-09-2017
12:06 PM
|
0
|
0
|
920
|
POST
|
Hi Robert, We registered a view of the joined tables with ArcGIS Server. (For some reason, ArcMap could join the tables but not publish them as a service.) So it's possible to join a non-spatial table with a map layer? William
... View more
02-09-2017
11:01 AM
|
0
|
20
|
1772
|
POST
|
Hi Drew, If you have a chance, I have a related question that I just posted as a separate thread. https://community.esri.com/message/665313-how-to-connect-data-to-a-map Thanks for all your help! William
... View more
02-09-2017
09:32 AM
|
0
|
0
|
892
|
POST
|
Hi, I have a map service that holds a non-geographic table from a non-ArcGIS database. I need to connect that data to the map, so the properties can be highlighted, etc. There are fields in the table that match data in the map, such as account_number. How do I match the two so I can get each properties' coordinates or am I going about this wrong? William
... View more
02-09-2017
09:31 AM
|
0
|
25
|
4834
|
POST
|
Hi, I need to query two tables from a map service. Below is how the SQL statement I would like to use might look. var queryString = "";
//from URL_For/MapServer/2
queryString += "Neighborhood_ID = '" + this.m_Neighborhood + "'";
queryString += " AND Use_Code_Dsc = '" + this.m_UseCodeOne + "'";
//from URL_For/MapServer/1
queryString += " AND convey_date = " + this._formatSqlDate(this.m_SaleDateSingle);
queryString += " AND consideration " + this.m_SalePriceOperatorDisplay + " " + this.m_SalePriceSingle;
query.where = queryString How would I use QueryTask? I have two URLs. Is there a way to join the tables and then perform the QueryTask? Thank you for your time. William
... View more
02-08-2017
06:24 AM
|
0
|
1
|
800
|
POST
|
Hi Drew, Below is my code for the QueryTask. var queryString = this._buildQueryString();
var query = new Query();
var queryTask = new QueryTask("URL_OF_ARCGIS_REST_SERVICE");
query.where = queryString;
query.outFields = ["ACCOUNT_NBR", "ADDRESS_LINE_1", "PROP_ZIP", "TOT_VAL", "LAND_VALUE", "BUILDING_VALUE", "SDWLL_NBR", "ROUTING_NBR", "LIVING_SPACE", "Sch_Dst_Dsc"];
queryTask.execute(query, lang.hitch(this, this._onSuccessfulQueryCompletion), lang.hitch(this, this._onFailedQueryCompletion)); When I run this code, the _onSuccessfulQueryCompletion executes. _onSuccessfulQueryCompletion: function(results) {
console.log('RatioQuery::_onSuccessfulQueryCompletion');
new Message({
titleLabel: "Ratio Query",
message: "SUCCESS"
});
console.info(results);
}, However, when I look at the data in the console, I don't see where any results are. Below is what displays in Chrome. What am I doing wrong? Thank you for all your help. William
... View more
02-07-2017
12:41 PM
|
0
|
2
|
892
|
POST
|
Hi Drew, The database has been added to the ArcGIS Rest Services Directory. Do I use esri/Request to query it? William
... View more
02-07-2017
07:42 AM
|
0
|
4
|
892
|
POST
|
Hi Drew, The database I need to connect to has real estate information that is updated regularly. I don't know, but I would guess that adding a table would not work for this situation. Please correct me if I'm wrong. I don't know much about Map Documents. William
... View more
02-07-2017
05:25 AM
|
0
|
6
|
1251
|
Title | Kudos | Posted |
---|---|---|
1 | 12-28-2016 08:09 AM | |
1 | 11-28-2016 08:34 AM | |
1 | 11-28-2016 08:39 AM | |
1 | 12-07-2016 06:14 AM | |
1 | 12-08-2016 08:44 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|