Select to view content in your preferred language

How do get my modification of the responsive-citizens app to work?

2940
3
Jump to solution
04-06-2015 01:54 PM
ChrisSergent
Deactivated User

I used this example as my base for creating an editing app: tomwayson/responsive-citizens · GitHub

The first thing I did was to attempt to replace the form but after attempting to comment fields that I don't need and JavaScript that I thought I did not need, the app is not running. What needs changed so that I can see the map, the fields and insert the data into our web server?

Here is my live non-working app: Street Signs

Here is the complete non-working application on Github: csergent45/streetSigns · GitHub

0 Kudos
1 Solution

Accepted Solutions
KellyHutchins
Esri Frequent Contributor

If you run the app with the dev tools open you'll see an error from line 144 of main.js. In that line of code you are setting the innerHTML property of an undefined div.  To test this set a breakpoint at line 144, run your app and then hover over app.requestTypeSelect and you'll see that its undefined.

app.requestTypeSelect.innerHTML = options.join('');

View solution in original post

3 Replies
KellyHutchins
Esri Frequent Contributor

If you run the app with the dev tools open you'll see an error from line 144 of main.js. In that line of code you are setting the innerHTML property of an undefined div.  To test this set a breakpoint at line 144, run your app and then hover over app.requestTypeSelect and you'll see that its undefined.

app.requestTypeSelect.innerHTML = options.join('');

ChrisSergent
Deactivated User

Okay that was appeared to be populating a dropdown list that I now have commented out. I updated the function to just initAttributeForm(); but now it displays undefined. And uploaded it to Github.

0 Kudos
ChrisSergent
Deactivated User

I changed this:

 var initAttributeForm = function () {
        var options = [];
    }
   




    //// initialize the request type drop down  
    //var initAttributeForm = function () {
    //    var options = [];
    //    for (var key in app.requestTypeFieldDomainCodedValuesDict) {
    //        if (app.requestTypeFieldDomainCodedValuesDict.hasOwnProperty(key)) {
    //            options.push('<option value="' + key + '">' + app.requestTypeFieldDomainCodedValuesDict[key] + '</option>');
    //        }
    //    }
    //    app.requestTypeSelect.innerHTML = options.join('');
    //};

Now I think I need to update the fields to display so they can be updated. And I need to figure out what is causing the form to pop-up as I will have two web services once all is said and done.

I'm am going to close this question so my others that I probably will have will be error specific just in case someone runs into the same type of error for something else.

0 Kudos