|
POST
|
I see what you and Kelly Hutchins pointed out, but when I comment out that line the point won't update. I received a response from twitter that updated my code on github with the following that made my application work: // 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.objectId = parseInt(attributes.objectId, 10);
graphic.setAttributes(attributes);
stopCaptureRequest();
console.log(attributes);
app.signLayer.applyEdits(null, [graphic], null).then(function (response) {
console.log(response);
});
app.signLayer.refresh();
}; Line 41 was added to remove quotes and I needed to keep line 43. Whenever I took line 43 out, there were no updates. In addition I had to add app.signLayer.refresh(); after the app.signLayer.applyEdits block to refresh the layer so that updated data would display when clicking on the map points.
... View more
05-27-2015
11:27 AM
|
0
|
0
|
2024
|
|
POST
|
Tried it out. No luck so far. Going to try again in the morning.
... View more
05-26-2015
03:35 PM
|
0
|
0
|
1053
|
|
POST
|
I am just updating the attributes, but I don't see how to exclude the graphics.
... View more
05-26-2015
03:34 PM
|
0
|
5
|
2024
|
|
POST
|
I did take out the hide line and then received an error, unable to completed function, so I believe it's something before I hide the form. The code never makes it to the second line of code shown here: app.signLayer.applyEdits([graphic], null, null).then(function (response) {
console.log(response);
app.signLayer.refresh();
});
... View more
05-26-2015
12:20 PM
|
0
|
0
|
2814
|
|
POST
|
This didn't work. With my latest updates I get this error message: and I have updated my project here:csergent45/streetSigns at 119dc2ec277a347c066f92fa13e0ca76f182fb8f · GitHub
... View more
05-26-2015
12:18 PM
|
0
|
0
|
2024
|
|
POST
|
I've checked this. All items have an OBJECTID. Or do you think I need to include this on my form?
... View more
05-26-2015
08:11 AM
|
0
|
2
|
2024
|
|
POST
|
I am not sure what to write for a callback. Do you have an example?
... View more
05-26-2015
07:23 AM
|
0
|
0
|
2814
|
|
POST
|
Yes, modal is a function. There is a file modal.js and I have use it on other elements to hide or show.
... View more
05-26-2015
07:18 AM
|
0
|
0
|
2814
|
|
POST
|
Robert, I'll have to look into that hopefully at home if I can this weekend. Our area looks like it's shutting down right now. I was getting an error on this statement though, couldn't figure out why: app.attributesSignModal.modal("hide");
... View more
05-22-2015
03:07 PM
|
0
|
3
|
2814
|
|
POST
|
Right and that's the way I have it in my first block of code.
... View more
05-22-2015
02:46 PM
|
0
|
6
|
2814
|
|
POST
|
My application will create new feature points, but will not update existing points. Is there different syntax besides the applyEdits to perform an update? I have debugged and the attributes are there when I start. They just don't take, which is why I thought my syntax may be wrong. Here is a block of code that I am trying to use for one of the updates: // 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;
}
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 an addSign that does work: // get sign attributes from form and submit
var addSigns = 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;
}
graphic.setAttributes(attributes);
stopCaptureRequest();
console.log(attributes);
app.signLayer.applyEdits([graphic], null, null).then(function (response) {
console.log(response);
app.signLayer.refresh();
});
}; and finally, here is my latest github commit: csergent45/streetSigns at 787b3ed59a446ca1cfcb8229d696b3445c4dda59 · GitHub
... View more
05-22-2015
02:15 PM
|
0
|
22
|
10356
|
|
POST
|
I had to modify some code for the order of my data being entered but that worked. Thanks!
... View more
05-22-2015
01:34 PM
|
0
|
0
|
2337
|
|
POST
|
I realized one other thing, in the function: applyEdits(adds?, updates?, deletes?, callback?, errback?) I probably need to create separate functions as some of my edits are creating a point and some are editing a point.
... View more
05-22-2015
12:21 PM
|
0
|
0
|
2337
|
|
POST
|
When I tagged you, I had an incident with support and originally was having a difficult time with it. They have told me since, that my code is refreshing the page on submit; not sure why. If I have a solution I will post it later. I just don't know what might cause a page to refresh without that code in JavaScript.
... View more
05-22-2015
12:00 PM
|
0
|
0
|
2337
|
| 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
|