|
POST
|
If this worked for you I can mark Tim Witt's answer as correct. I don't know if you see that option since I created this group.
... View more
05-21-2015
02:27 PM
|
1
|
1
|
2283
|
|
BLOG
|
Does this mean that HTML5 geolocation will no longer work in Google Chrome if it's http?
... View more
05-20-2015
06:36 AM
|
0
|
0
|
8532
|
|
POST
|
In my application I can click on a point or add a point to a sign or support layer, but my support layer does not appear to apply the edits and my sign layer does not appear to apply edits or add graphics. I also have this project on github at: csergent45/streetSigns · GitHub and the file that I am working on is in app/main.js Any ideas on this Tom Wayson ? I see the edits in the console.log, but they don't apply right after that. Here is my code for both layers: // temporarily show alert when starting edits
// and then start listening for a map click
var startCaptureRequest = function (severity) {
var listener;
// NOTE: once user has clicked "x" to dismiss
// this alert, it will no longer show up
domStyle.set(app.startEditAlert, "display", "");
setTimeout(function () {
domStyle.set(app.startEditAlert, "display", "none");
}, 3000);
// save map point in app global and
listener = app.map.on("click", function (e) {
listener.remove();
// save map point in app global and
// show form to collect incident report
app.currentGeometry = e.mapPoint;
/* Show signs form */
if (severity === "0") {
document.getElementById("signForm").reset();
app.attributesSignModal.modal("show");
/* Enter your domain item and then the element to populate */
populateSelect("BACKING", "backing","sign");
populateSelect("VISIBILITY", "visibility","sign");
populateSelect("CONDITION_", "condition","sign");
populateSelect("COLOR1", "color1","sign");
populateSelect("DELINEATOR", "delineator","sign");
populateSelect("ILLUM", "illum","sign");
populateSelect("ATTACHTYPE", "attachType","sign");
populateSelect("ATTACHLOC", "attachLoc","sign");
populateSelect("SITEOBS", "siteObs","sign");
populateSelect("SIGNSHAPE", "signShape","sign");
populateSelect("COLOR2", "color2","sign");
populateSelect("MUTCD", "mutcd","sign");
/* Show supports form */
} else if (severity === "1") {
document.getElementById("supportForm").reset();
app.attributesModal.modal("show");
/* 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");
}
});
};
var stopCaptureRequest = function () {
app.currentGeometry = null;
};
// get attributes from form and submit
var submitSupports = 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;
}
graphic.setAttributes(attributes);
stopCaptureRequest();
//console.log(attributes);
app.supportLayer.applyEdits([graphic], null, null).then(function (response) {
console.log(response);
});
};
// get sign attributes from form and submit
var submitSigns = 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);
});
};
... View more
05-19-2015
01:26 PM
|
0
|
5
|
5920
|
|
POST
|
I looked at the references and I don't see a reference to bootstrap or esriBootstrap for mobile. Unless there are media queries to adjust based on screen size, the CSS will be the same in all devices which is why you can see it on an iPad; there is more screen space.
... View more
05-19-2015
11:59 AM
|
0
|
0
|
717
|
|
POST
|
My click event should have been: app.signLayer.on("click", function (evt) { instead of: app.signLayer.on("click"), function (evt) { problem solved.
... View more
05-19-2015
11:52 AM
|
1
|
0
|
976
|
|
POST
|
I have two forms, one for a support layer and one for a sign layer. The support layer connects to my data and displays on the form. On the sign form, however, I receive the following error: Uncaught TypeError: Cannot read property 'call' of undefined The error is in the init.js:799 I have updated my code on github at: csergent45/streetSigns · GitHub The file that I am updating is in the app/main.js file. If you would like to test it, enter an address of 100 S Main St, Decatur, Illinois. You can then click on the points which should display a form. So this works: /* Update Support Layer Begin */
app.supportLayer.on("click", function (evt) {
/* Get support information on click */
var supportId, type, address, size, material, base, rating, dateInv, inspector, comments, addrCode;
// declare rest endpoint values
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("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
app.attributesModal.modal("show");
});
/* Update Support Layer End */ And this does not work: /* Update Sign Layer Begin */
app.signLayer.on("click"), function (evt) {
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
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;
mutcd = evt.graphic.attributes.MUTCD;
// Clear form of values before connecting current values
document.getElementById("signForm").reset();
/* Enter your domain item and then the element to populate */
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");
populateSelect("MUTCD", "mutcd", "sign");
/* Populate form with data */
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("mutcd").value = mutcd;
// Show signs form for updating
app.attributesSignModal.modal("show");
}
/* Update Sign Layer End */ I did find it interesting that on the first one I had to add a ); but on the second one, this was not needed. Any ideas?
... View more
05-19-2015
10:00 AM
|
0
|
1
|
4126
|
|
POST
|
I needed to populate the form before I opened it. Issue solved. document.getElementById("address").value = address;
document.getElementById("supportId").value = supportId;
document.getElementById("type").value = type;
console.log(supportId);
console.log(type);
console.log(address);
// Show supports form for updating
app.attributesModal.modal("show");
... View more
05-15-2015
02:18 PM
|
1
|
0
|
791
|
|
POST
|
I populate my form based on a map click event which had been working, but no longer is. I have uploaded the current code on Github at: csergent45/streetSigns · GitHub If you would like to see how to re-create the error that I am running into, I have a screen recording explaining how: The error that I receive is: Uncaught TypeError: Cannot read property 'defaultPrevented' of undefined from: http://rawgit.com/xsokev/Dojo-Bootstrap/master/Modal.js The code that populates or should populate my for input boxes is the following: /* Get support information on click */
var supportId, type, address;
app.supportLayer.on("click", function (evt) {
// declare rest endpoint values
supportId = evt.graphic.attributes.SUPPORTID;
type = evt.graphic.attributes.TYPE;
address = evt.graphic.attributes.ADDRESS;
app.attributesModal.modal("show");
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");
// Show supports form for updating
app.attributesModal.modal("show");
document.getElementById("address").value = address;
document.getElementById("supportId").value = supportId;
document.getElementById("type").value = type;
console.log(supportId);
console.log(type);
console.log(address);
});
... View more
05-15-2015
02:12 PM
|
0
|
1
|
4218
|
|
POST
|
I forget that. .NET had me spoiled with server side code.
... View more
05-15-2015
12:07 PM
|
0
|
0
|
2442
|
|
POST
|
I don't know why but when I re-updated the code, it worked.
... View more
05-15-2015
11:58 AM
|
0
|
2
|
2442
|
|
POST
|
I got this error when I added that: Uncaught TypeError: Cannot read property 'defaultPrevented' of undefined And it did not clear the form, but I did add form tags. I uploaded the most recent version of my app on github: csergent45/streetSigns · GitHub
... View more
05-15-2015
10:15 AM
|
0
|
0
|
3048
|
|
POST
|
I don't know why but that only populated part of the dropdown lists. I uploaded the most recent version of my app on github: csergent45/streetSigns · GitHub
... View more
05-15-2015
10:10 AM
|
0
|
4
|
2442
|
|
POST
|
I think I had something like that before and I got that it was not a function.
... View more
05-15-2015
10:01 AM
|
0
|
0
|
2442
|
|
POST
|
I am trying to reset a form for data entry once the form displays to ensure there are no previous values but I get the following error when I try reset: Uncaught TypeError: document.getElementById(...).reset is not a function The code I am using is: document.getElementById("attributesSignModal").reset(); A common mistake is having an element named reset, but I don't have that issue on my application. Here is the form that I can not reset: <!-- Attributes Sign Modal Begin -->
<div id="attributesSignModal" class="modal fade" style="display: none;" aria-hidden="true">
<!-- Modal Dialog Begin -->
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Add/Edit Sign</h4>
</div>
<div class="modal-body">
<!-- Installed Begin -->
<div class="form-group">
<label for="installed">Installed</label>
<input type="date" class="form-control" name="installed" id="installed" />
</div>
<!-- Installed End -->
<!-- Sign ID Begin -->
<div class="form-group">
<label for="signId">Sign ID</label>
<input type="number" class="form-control" placeholder="Sign ID" name="signId" id="signId" />
</div>
<!-- Sign ID End -->
<!-- Facing Begin -->
<div class="form-group">
<label for="facing">Facing</label>
<input type="text" class="form-control" placeholder="Facing" name="facing" id="facing" />
</div>
<!-- Facing End -->
<!-- Visibility Begin -->
<div class="form-group">
<label for="visibility">Visibility</label>
<select id="visibility" class="form-control" name="visibility">
</select>
</div>
<!-- Visibility End -->
<!-- Condition Begin -->
<div class="form-group">
<label for="condition">Condition</label>
<select id="condition" class="form-control" name="visibility">
</select>
</div>
<!-- Condition End -->
<!-- Support ID Begin -->
<div class="form-group">
<label for="supportId">Support ID</label>
<input type="number" class="form-control" name="supportId" id="supportId" />
</div>
<!-- Support ID End -->
<!-- Text Begin -->
<div class="form-group">
<label for="text">Text</label>
<input type="text" class="form-control" name="text" id="text" />
</div>
<!-- Text End -->
<!-- Color 1 Begin -->
<div class="form-group">
<label for="color1">Color 1</label>
<select id="color1" class="form-control" name="color1" required>
</select>
</div>
<!-- Color 1 End -->
<!-- Delineator Begin -->
<div class="form-group">
<label for="delineator">Delineator</label>
<select id="delineator" class="form-control" name="delineator">
</select>
</div>
<!-- Delineator End -->
<!-- Illum Begin -->
<div class="form-group">
<label for="illum">Illum</label>
<select id="illum" class="form-control" name="illum">
</select>
</div>
<!-- Illum End-->
<!-- Offset Begin -->
<div class="form-group">
<label for="offset">Offset</label>
<input type="text" class="form-control" name="offset" id="offset" />
</div>
<!-- Offset Ends -->
<!-- Mountht Begin -->
<div class="form-group">
<label for="mountht">MOUNTHT</label>
<input type="text" class="form-control" name="mountht" id="mountht"/>
</div>
<!-- Mountht End -->
<!-- Backing Begin -->
<div class="form-group">
<label for="backing">Backing</label>
<select id="backing" class="form-control" name="backing">
</select>
</div>
<!-- Backing End -->
<!-- Width Begin -->
<div class="form-group">
<label for="width">Width</label>
<input type="text" class="form-control" name="width" id="width" />
</div>
<!-- Width End -->
<!-- Height Begin -->
<div class="form-group">
<label for="height">Height</label>
<input type="text" class="form-control" name="height" id="height"/>
</div>
<!-- Height End -->
<!-- Txt Size Begin -->
<div class="form-group">
<label for="txtSize">Text Size</label>
<input type="text" class="form-control" name="txtSize" id="txtSize"/>
</div>
<!-- Txt Size End -->
<!-- Num Size Begin -->
<div class="form-group">
<label for="numSize">Numsize</label>
<input type="text" class="form-control" name="numSize" id="numSize"/>
</div>
<!-- Num Size End -->
<!-- Comments Begin -->
<div class="form-group">
<label for="comments">Comments</label>
<input type="text" class="form-control" name="comments" id="comments"/>
</div>
<!-- Comments End -->
<!-- Two Sided Begin -->
<div class="form-group">
<label for="twoSided">Two Sided</label>
<input type="text" class="form-control" name="twoSided" id="twoSided" />
</div>
<!-- Two Sided End -->
<!-- Attach Type Begin -->
<div class="form-group">
<label for="attachType">Attach Type</label>
<select id="attachType" class="form-control" name="attachType">
</select>
</div>
<!-- Attach Type End -->
<!-- Attach Num Begin -->
<div class="form-group">
<label for="attachNum">Attach Num</label>
<input type="text" class="form-control" name="attachNum" id="attachNum"/>
</div>
<!-- Attach Num End -->
<!-- Attach Loc Begin -->
<div class="form-group">
<label for="attachLoc">Attach Loc</label>
<select id="attachLoc" class="form-control" name="attachLoc">
</select>
</div>
<!-- Attach Loc End -->
<!-- siteObs Begin -->
<div class="form-group">
<label for="siteObs">Siteobs</label>
<select id="siteObs" class="form-control" name="siteObs">
</select>
</div>
<!-- siteObs End -->
<!-- Sign Shape Begin -->
<div class="form-group">
<label for="signShape">Sign Shape</label>
<select id="signShape" class="form-control" name="signShape">
</select>
</div>
<!-- Sign Shape End -->
<!-- Color 2 Begin -->
<div class="form-group">
<label for="color2">Color 2</label>
<select id="color2" class="form-control" name="color2">
</select>
</div>
<!-- Color 2 End -->
<!-- Mutcd Begin -->
<div class="form-group">
<label for="mutcd">MUTCD</label>
<select id="mutcd" class="form-control" name="mutcd">
</select>
</div>
<!-- Mutcd End -->
<button class="btn btn-success">Submit</button>
<button class="btn btn-default">Cancel</button>
<button id="btnPrevious" class="btn navButton" style="visibility:hidden">Previous</button>
<button id="btnNext" class="btn navButton" style="visibility:hidden">Next</button>
</div>
</div>
</div>
<!-- Modal Dialog End -->
</div>
<!-- Attributes Sign Modal End -->
... View more
05-15-2015
09:43 AM
|
0
|
2
|
8066
|
| 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
|