jpsember / golang-base

Jeff's basic Go library
0 stars 0 forks source link

Browser log complaining of missing id #66

Closed jpsember closed 1 year ago

jpsember commented 1 year ago
*** WARNING; processServerResponse (https://jeff.org/base.js:79:15) : can't find element with id: .11
base.js:22 
jpsember commented 1 year ago

I think we are sending back unnecessary markup sometimes. We seem to be sending container widgets, whose markup contains the markup of the widgets they contain, as well as the individual contained widget's markup:

sending back to Ajax caller:
    { "u" : "/edit/42",
      "w" : {                      ".5" : "<h6 style=\"font-size:50%\" class=\"text-end\" id='.5'>edit, user:manager1</h6>",
                                   ".6" : "\n\n<!-- ContainerWidget Id: .6 -->\n<div id='.6'>\n  <div class='row'>\n\n    <!-- child -->\n    <div class=\"col-sm-12\">\n      <div id=\"_create_animal_.summary\">\n        <!-- Label -->\n        <label class=\"form-label\" style=\"font-size:70%\">\n          Summary\n        </label>\n\n        <!-- Input -->\n        <input class=\"form-control\" type=\"text\" id=\"_create_animal_.summary.aux\" value=\"ek idfusu swkvukra\" onchange='jsVal(\"_create_animal_.summary\")'>\n      </div>\n    </div>  <!-- child -->\n\n  </div>\n\n</div>  <!-- ContainerWidget Id: .6 -->",
              "_create_animal_.summary" : "<div id=\"_create_animal_.summary\">\n  <!-- Label -->\n  <label class=\"form-label\" style=\"font-size:70%\">\n    Summary\n  </label>\n\n  <!-- Input -->\n  <input class=\"form-control\" type=\"text\" id=\"_create_animal_.summary.aux\" value=\"ek idfusu swkvukra\" onchange='jsVal(\"_create_animal_.summary\")'>\n</div>",
                                 "page" : "\n\n<!-- ContainerWidget Id: page -->\n<div id='page'>\n  <div class='row'>\n\n    <!-- child -->\n    <div class=\"col-sm-12\">\n      <h6 style=\"font-size:50%\" class=\"text-end\" id='.5'>edit, user:manager1</h6>\n    </div>  <!-- child -->\n\n  </div>\n\n  <div class='row'>\n\n    <!-- child -->\n    <div class=\"col-sm-6\">\n\n      <!-- ContainerWidget Id: .6 -->\n      <div id='.6'>\n        <div class='row'>\n\n          <!-- child -->\n          <div class=\"col-sm-12\">\n            <div id=\"_create_animal_.summary\">\n              <!-- Label -->\n              <label class=\"form-label\" style=\"font-size:70%\">\n                Summary\n              </label>\n\n              <!-- Input -->\n              <input class=\"form-control\" type=\"text\" id=\"_create_animal_.summary.aux\" value=\"ek idfusu swkvukra\" onchange='jsVal(\"_create_animal_.summary\")'>\n            </div>\n          </div>  <!-- child -->\n\n        </div>\n\n      </div>  <!-- ContainerWidget Id: .6 -->\n\n    </div>  <!-- child -->\n\n  </div>\n\n</div>  <!-- ContainerWidget Id: page -->"
            }
    }