|
POST
|
I would like to thank Kyle Morgan for helping me out with this issue. It has been resolved and here is the solution, should you need it. If you create two forms, you need to watch out for duplicate form element names. Both layers have an OjectId but on one form I used signObjectId, but this will not permit your updated code to go to the server, you need to convert your field signObjectId to objectId. You also want to refresh the graphics to ensure that the data displays the updated data on the next click event as follows: // Preparing the data for processing to the server
attributes.ObjectID = parseInt(attributes.signObjectId, 10);
delete attributes.signObjectId;
attributes.supportId = parseInt(attributes.signSupportId, 10);
delete attributes.signSupportId;
attributes.comments = attributes.signComments;
delete attributes.signComments;
graphic.setAttributes(attributes);
stopCaptureRequest();
console.log(attributes);
app.signLayer.applyEdits(null, [graphic], null).then(function (response) {
console.log(response);
});
// refreshing the layer and graphics to update the points for the onclick method
app.signLayer.refresh();
graphic.refresh();
... View more
06-09-2015
01:28 PM
|
1
|
0
|
814
|
|
POST
|
I have uploaded my recent version of my application on github: csergent45/streetSigns at 8b5b613676474eebed160981cb654b41107da459 · GitHub I also republished the application at Street Signs - If you try it, don't allow location as it will not show you the map because the data is for Decatur, Illinois. Before I had an issue with my updates not being applied because I was not converting an ObjectId to a number, but I do that with both forms and neither will now update. Any ideas what I am doing wrong? : The sign layer information on click: var installed, signId, facing, visibility, condition, supportId, text, color1, delineator, illum, offset;
var mountht, backing, width, height, txtSize, numSize, comments, twoSided, attachType, attachNum, attachLoc, siteObs, signShape, color2, mutcd;
var objectId;
objectId = evt.graphic.attributes.OBJECTID;
mutcd = evt.graphic.attributes.MUTCD;
installed = evt.graphic.attributes.INSTALLED;
signId = evt.graphic.attributes.SIGNID;
facing = evt.graphic.attributes.FACING;
visibility = evt.graphic.attributes.VISIBILITY;
condition = evt.graphic.attributes.CONDITION_;
supportId = evt.graphic.attributes.SUPPORTID;
text = evt.graphic.attributes.TEXT;
color1 = evt.graphic.attributes.COLOR1;
delineator = evt.graphic.attributes.DELINEATOR;
illum = evt.graphic.attributes.ILLUM;
offset = evt.graphic.attributes.OFFSET;
mountht = evt.graphic.attributes.MOUNTHT;
backing = evt.graphic.attributes.BACKING;
width = evt.graphic.attributes.WIDTH;
height = evt.graphic.attributes.HEIGHT;
txtSize = evt.graphic.attributes.TXTSIZE;
numSize = evt.graphic.attributes.NUMSIZE;
comments = evt.graphic.attributes.COMMENTS;
twoSided = evt.graphic.attributes.TWOSIDED;
attachType = evt.graphic.attributes.ATTACHTYPE;
attachNum = evt.graphic.attributes.ATTACHNUM;
attachLoc = evt.graphic.attributes.ATTACHLOC;
siteObs = evt.graphic.attributes.SITEOBS;
signShape = evt.graphic.attributes.SIGNSHAPE;
color2 = evt.graphic.attributes.COLOR2;
// Clear form of values before connecting current values
document.getElementById("signForm").reset();
/* Enter your domain item and then the element to populate */
populateSelect("MUTCD", "mutcd", "sign");
populateSelect("VISIBILITY", "visibility", "sign");
populateSelect("CONDITION_", "condition", "sign");
populateSelect("COLOR1", "color1", "sign");
populateSelect("DELINEATOR", "delineator", "sign");
populateSelect("ILLUM", "illum", "sign");
populateSelect("BACKING", "backing", "sign");
populateSelect("ATTACHTYPE", "attachType", "sign");
populateSelect("ATTACHLOC", "attachLoc", "sign");
populateSelect("SITEOBS", "siteObs", "sign");
populateSelect("SIGNSHAPE", "signShape", "sign");
populateSelect("COLOR2", "color2", "sign");
/* Populate form with data */
document.getElementById("signObjectId").value = objectId;
document.getElementById("mutcd").value = mutcd;
document.getElementById("installed").value = installed;
document.getElementById("signId").value = signId;
document.getElementById("facing").value = facing;
document.getElementById("visibility").value = visibility;
document.getElementById("condition").value = condition;
document.getElementById("supportId").value = supportId;
document.getElementById("text").value = text;
document.getElementById("color1").value = color1;
document.getElementById("delineator").value = delineator;
document.getElementById("illum").value = illum;
document.getElementById("offset").value = offset;
document.getElementById("mountht").value = mountht;
document.getElementById("backing").value = backing;
document.getElementById("width").value = width;
document.getElementById("height").value = height;
document.getElementById("txtSize").value = txtSize;
document.getElementById("numSize").value = numSize;
document.getElementById("comments").value = comments;
document.getElementById("twoSided").value = twoSided;
document.getElementById("attachType").value = attachType;
document.getElementById("attachNum").value = attachNum;
document.getElementById("attachLoc").value = attachLoc;
document.getElementById("siteObs").value = siteObs;
document.getElementById("signShape").value = signShape;
document.getElementById("color2").value = color2;
document.getElementById("btnSignUpdate").style.visibility = "visible";
// Show signs form for updating
app.attributesSignModal.modal("show"); }); /* Update Sign Layer End */ The sign layer update: // get sign attributes from form and submit
var updateSigns = function () {
// alert(domClass.contains("attributesSignModal", "in"));
var attributes = {
// TODO: not sure if this is needed
//requestreceived: null
};
var currentDate = new Date(); // current date is defined but never used.
var graphic;
graphic = new Graphic(app.currentGeometry);
query("#attributesSignModal input, #attributesSignModal select, #attributesSignModal textarea").forEach(function (formInput) {
attributes[formInput.name] = formInput.value;
});
// Form validation - ensures that the values for the data are here if left blank
if ((attributes.installed === undefined) || (attributes.installed === "")) {
attributes.installed = null;
}
if ((attributes.signId === undefined) || (attributes.signId === "")) {
attributes.signId = null;
}
if ((attributes.supportId === undefined) || (attributes.supportId === "")) {
attributes.supportId = null;
}
attributes.signObjectId = parseInt(attributes.signObjectId, 10);
graphic.setAttributes(attributes);
stopCaptureRequest();
console.log(attributes);
app.signLayer.applyEdits(null, [graphic], null).then(function (response) {
console.log(response);
});
app.signLayer.refresh();
}; And here is the information for the support layer that was working before: Support layer onClick: /* Update Support Layer Begin */
app.supportLayer.on("click", function (evt) {
/* Get support information on click */
var objectId, supportId, type, address, size, material, base, rating, dateInv, inspector, comments, addrCode;
// declare rest endpoint values
objectId = evt.graphic.attributes.OBJECTID;
supportId = evt.graphic.attributes.SUPPORTID;
type = evt.graphic.attributes.TYPE;
address = evt.graphic.attributes.ADDRESS;
size = evt.graphic.attributes.SIZE_;
material = evt.graphic.attributes.MATERIAL;
base = evt.graphic.attributes.BASE;
rating = evt.graphic.attributes.RATING;
dateInv = evt.graphic.attributes.DATEINV;
inspector = evt.graphic.attributes.INSPECTOR;
comments = evt.graphic.attributes.COMMENTS;
addrCode = evt.graphic.attributes.ADDRCODE;
// Clear form of values before connecting current values
document.getElementById("supportForm").reset();
/* Enter your domain item and then the element to populate */
populateSelect("TYPE", "type", "support");
populateSelect("SIZE_", "size", "support");
populateSelect("MATERIAL", "material", "support");
populateSelect("BASE", "base", "support");
populateSelect("RATING", "rating", "support");
/* Populate form with data */
document.getElementById("objectId").value = objectId;
document.getElementById("address").value = address;
document.getElementById("supportId").value = supportId;
document.getElementById("type").value = type;
document.getElementById("size").value = size;
document.getElementById("material").value = material;
document.getElementById("base").value = base;
document.getElementById("rating").value = rating;
document.getElementById("dateInv").value = dateInv;
document.getElementById("inspector").value = inspector;
document.getElementById("comments").value = comments;
document.getElementById("addrCode").value = addrCode;
// Show supports form for updating
document.getElementById("btnSupportUpdate").style.visibility = "visible";
app.attributesModal.modal("show");
});
/* Update Support Layer End */ Support layer update: // get attributes from form and submit
var updateSupports = function () {
//alert(domClass.contains("attributesModal", "in"));
var attributes = {
// TODO: not sure if this is needed
//requestreceived: null
};
var currentDate = new Date(); // current date is defined but never used.
var graphic;
graphic = new Graphic(app.currentGeometry);
query("#attributesModal input, #attributesModal select, #attributesModal textarea").forEach(function (formInput) {
attributes[formInput.name] = formInput.value;
});
// Form Validation - ensures that the values for the database are here if left blank
if ((attributes.supportId === undefined) || (attributes.supportId === "")) {
attributes.supportId = null;
}
if ((attributes.dateInv === undefined) || (attributes.dateInv === "")) {
attributes.dateInv = null;
}
if ((attributes.addrCode === undefined) || (attributes.addrCode === "")) {
attributes.addrCode = null;
}
attributes.objectId = parseInt(attributes.objectId, 10);
graphic.setAttributes(attributes);
stopCaptureRequest();
//console.log(attributes);
app.supportLayer.applyEdits(null, [graphic], null).then(function (response) {
console.log(response);
});
app.supportLayer.refresh();
};
... View more
06-08-2015
12:16 PM
|
0
|
1
|
3069
|
|
POST
|
You've gotta map it and where is your map? Probably should be my last comment off topic.
... View more
06-04-2015
02:04 PM
|
0
|
0
|
430
|
|
POST
|
Thanks Robert Burke. This helps. All is well. and a Jimmy John's cheer to you.
... View more
06-04-2015
12:06 PM
|
0
|
2
|
4707
|
|
POST
|
Thanks and to you to Robert Scheitlin, GISP I plan on breaking things with this tool as well; will be posting again I am sure, but this helps me to get started.
... View more
06-03-2015
01:51 PM
|
1
|
1
|
4707
|
|
POST
|
I installed Web App Builder for Developers on my machine and would like to know what Web App Builder for Developers has that Web App Builder does not have. And how do you access the code?
... View more
06-03-2015
01:07 PM
|
2
|
10
|
9569
|
|
POST
|
If you are saying that the legend and other elements are covered by the map because the map takes up the entire space, you can set a z-index:0; in your css for the map like so: #map
{
z:index:0;
}
#legend
{
z:index:50;
} This will place your legend on top of the map. If the legend is not where you want it, you may want to use absolute positioning.
... View more
06-03-2015
09:26 AM
|
1
|
1
|
4500
|
|
POST
|
Same here. I liked and still like XML, but migrated to JavaScript/HTML5. I still develop in .NET however for server applications.
... View more
06-02-2015
09:03 AM
|
0
|
0
|
3178
|
|
POST
|
I guess Mozilla Firefox or another browser for others in the future. Thanks for the additional update.
... View more
06-02-2015
07:50 AM
|
0
|
2
|
3178
|
|
POST
|
Just wanted to share the following for anyone that has had issues with Silverlight in Google Chrome: The latest update of Google Chrome has disabled Silverlight. When navigating to a site that requires Silverlight, you will be notified to install Silverlight. Once you attempt to install Silverlight, you most likely will be told that Silverlight is already installed. To resolve this issue for yourself or any other City staff that may need it, you can follow these steps and Silverlight will work again: http://support.panopto.com/documentation/admin-and-setup/troubleshooting/enabling-silverlight-plugin-npapi-plugins-chrome
... View more
06-02-2015
07:06 AM
|
0
|
8
|
7073
|
|
POST
|
Any idea why that option may be dimmed out. Is it in settings?
... View more
05-29-2015
11:26 AM
|
0
|
2
|
4218
|
|
POST
|
A question was asked in an online class I was taking. I know you can convert a model to Python, but can you convert Python to a model?
... View more
05-29-2015
11:17 AM
|
0
|
5
|
7493
|
|
POST
|
I may want to share one of my Esri JavaScript API web apps. Is it possible to embed it in a Word document to see it live in the document, but to use the document to explain it?
... View more
05-28-2015
08:25 AM
|
0
|
3
|
7806
|
|
POST
|
That's what ended up working for me by typing the following: attributes.objectId = parseInt(attributes.objectId, 10); Here is my commit on github where I updated my code is anyone needs it as a reference: csergent45/streetSigns at a59d005160c3a16346b8b4ad3fdb445d287d1b40 · GitHub
... View more
05-27-2015
11:30 AM
|
0
|
0
|
1053
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-26-2015 12:31 PM | |
| 1 | 06-24-2015 06:06 AM | |
| 1 | 07-15-2015 12:34 PM | |
| 1 | 05-21-2015 02:27 PM | |
| 1 | 05-19-2015 11:52 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|