Blank screen on page load, with this error. Any ideas?
I’m not a master of javascript debugging but the last line jumps out to me. Click on it and take another screenshot of the source code surrounding line 82.
You asked for it
Here are the contents of line 82. Looks like the XML for the entire page.
skuid.component.factory('#skuid-page-a0fF00000092AN2IAM-component-1','{{Name}}STD ProcessInteractionPatientCaseInteractionsTableRelatedPersonSTDSTDTestPatientCaseInteractionRelatedPersonPatientSTDCategoryPurposeTypePermission to Say "CompassCare"Other RelationshipInsert List of STD Tests here for RN to review with Patient.Anal Sex Given (M)Anal Sex Received (M/F)Vaginal Sex Given (M)Vaginal Sex Received (F)Oral Sex Given (M/F)Oral Sex Received (M/F)Other STD<h1>STD History</h1><strong>Test</strong><strong>Results</strong><strong>Reported to Patient</strong><strong>Reported to Health Dept.</strong><strong>Treatment</strong><h1>Physicians</h1>Description{{Description1__c}} {{Description2__c}}Address<h1>Insurance</h1>Description<h1>Additional Referrals</h1>Description{{Description1__c}} {{Description2__c}}AddressOther Religious Background<h1>MotherCare</h1>Address<custom name="scriptJTex
Looking again, it’s not all the XML, just everything inside .
Hence the name “skuid.component.factory” I presume.
hehehe… a screenshot. Not copy paste.
While we’re at it, here’s line 28 of skuid__SkuidJS, which is throwing the error:
W=new a.model.Condition,W.operator="gte",W.field=Y,W.inactive=!0,W.name=Z,W.encloseValueInQuotes=!1,X=new a.model.Condition,X.operator="lte",X.field=Y,X.inactive=!0,X.name=$,X.encloseValueInQuotes=!1,v.model.addCondition(W),v.model.addCondition(X)}if(d=v.model.getField(W.field),e=v.model.getField(X.field),!d||!e)return!1;var _,ab,bb=d.displaytype,cb=e.displaytype;W.inactive?_="":"DATETIME"===bb?(i=q(W.value),_=r(i)):(i=p(W.value),_=W.value),X.inactive?ab="":"DATETIME"===cb?(j=q(X.value),j.setDate(j.getDate()-1),ab=r(j)):(j=p(X.value),ab=X.value);var db=function(){eb.datepicker("getDate")||fb.datepicker("getDate")?pb.show():pb.hide()},eb=A.DATE.edit({value:_,onChange:db}).addClass("sk-timefilter-input"),fb=A.DATE.edit({value:ab,onChange:db}).addClass("sk-timefilter-input");v.element.addClass("nx-actionselect nx-conditiontoken");var gb,hb,ib=l("
"+t("error")+": "+c:"")})})},d.prototype.makeConditionsBar=function(){this.makeFiltersBar()},d.prototype.enableFiltersAndSearch=function(){var a,b=this;b.conditionsBar&&(a=b.conditionsBar.find(".nx-conditiontoken"),a.removeClass("unavailable"),a.children("select").multiselect("enable")),"server"===b.searchMethod&&b.searchBox&&b.searchBox.prop("disabled",!1)},d.prototype.disableFiltersAndSearch=function(){var a,b=this;b.conditionsBar&&(a=b.conditionsBar.find(".nx-conditiontoken"),a.addClass("unavailable"),a.children("select").multiselect("disable")),"server"===b.searchMethod&&b.searchBox&&b.searchBox.prop("disabled",!0)},d.prototype.blockUI=function(a){var b=this;a=a||{};var c={message:a.message};b.options.blockUICSS&&(c.css=b.options.blockUICSS),b.options.blockOverlayCSS&&(c.overlayCSS=b.options.blockOverlayCSS),b.editor.element.block(c)},d.prototype.unblockUI=function(a){var b=this;a=a||{};var c={};a.failmessage?(b.options.blockUICSS&&(c.css=b.options.blockUICSS),b.options.blockOverlayCSS&&(c.overlayCSS=b.options.blockOverlayCSS),c.timeout=a.timeout||4e3,c.message=a.failmessage,b.editor.element.block(c)):b.editor.element.unblock()},d.prototype.makeFiltersBar=function(){var a=this,b=a.options.listFilters;if(a.filters=i],!b)return!1;var c=a.conditionsBar;return c.empty(),l.each(b.children(),function(){var b=new g({xml:l(this),list:a});a.filters.push(b),b&&b.element&&c.append(b.element)}),c},d.prototype.nextPage=function(){this.currentPage++,this.render({refreshFields:!1})},d.prototype.prevPage=function(){this.currentPage--,this.render({refreshFields:!1})},d.prototype.goToPage=function(a){this.currentPage=a,this.render({refreshFields:!1})},e.prototype.id=function(){return this._GUID},e.prototype.render=function(){if(this.list&&this.list.views&&this.list.currentView){var a=this.list.viewstthis.list.currentView];this.element&&this.element.remove(),this.element=l("<"+(a.itemNodeType||"div")+">").addClass("nx-item"),this.element.data("object",this),a.render(this)}return this},e.prototype.refreshFields=function(a){var b=this;return l.each(b.fields,function(){(b.mode!==this.mode||!a||this.id in a)&&(this.mode=b.mode,this.render())}),b},e.prototype.resetMode=function(){return this.mode!==this.defaultMode&&(this.mode=this.defaultMode),this},e.prototype.toggleEdit=function(){return"readonly"!==this.mode&&(this.mode="read"==this.mode?"edit":"read",this.refreshFields()),this},e.prototype.toggleDelete=function(a){var b=this;return b.deleted?b.unMarkForDelete(a):b.markForDelete(a),b},e.prototype.handleUnmarkRowForDeletion=function(a){return!this.row||this.row!==a&&this.row.Id!=a.Id||this.unMarkForDelete(!1),this},e.prototype.handleMarkRowForDeletion=function(a){return!this.row||this.row!==a&&this.row.Id!=a.Id||this.markForDelete(!1),this},e.prototype.unMarkForDelete=function(a){return this.element.removeClass("deleted"),this.deleted=!1,a&&this.list.model.undeleteRow(this.row),this},e.prototype.markForDelete=function(a){return this.element.addClass("deleted"),this.deleted=!0,a&&this.list.model.deleteRow(this.row),this},e.prototype.registerField=function(a){this.fields.push(a)},e.prototype.unregister=function(){var a=this;return a.list&&a.list.model&&a.list.model.unregisterItem(this),a.fields&&a.fields.length&&l.each(a.fields,function(){this.destroy()}),a},e.prototype.destroy=function(){this.element&&this.element.remove(),this.unregister()},f.prototype.uid=function(){return this._GUID},f.prototype.register=function(a){return this.model&&this.model.registerField(this,a),this},f.prototype.unregister=function(){var a=this,b=a.options;a.model&&a.model.unregisterField(a,b?b.controllingFields:!1)},f.prototype.calculateReferenceText=function(){return n.calculateReferenceText({model:this.model,row:this.row,template:this.options.template,fieldMetadata:this.metadata})},f.prototype.calculateReferenceMerges=function(a){return a||(a={}),n.calculateReferenceMerges(l.extend(a,{model:this.model,row:this.row,template:this.options.template,fieldMetadata:this.metadata}))},f.prototype.getValidPicklistEntries=function(){var a,b,c=n.toArray,d=this,e=d.item,f=this.metadata.controllingField,g=function(a,b){var c=new sforce.Base64Binary(""),d=c.decode(b),e=d.charCodeAt(a>>3);return 0!==(e&128>>a%8)},h=e&&e.ValidRecordTypeIds?e.ValidRecordTypeIds:y],i=d.model.getFieldValue(d.row,"RecordTypeId",!0);if(i&&-1===l.inArray(i,h)&&h.push(i),h.length&&(a=n.getPicklistEntriesValidForRecordTypes(this.model.objectName,d.id,h)),f){var j,k,m=n.getAPIDescribeSObject(this.model.objectName);if(m&&(l.each(c(m.fields),function(){return d.id===this.name?j=this:d.metadata.controllingField===this.name&&(k=this),j&&k?!1:void 0}),j&&k)){var o,p=d.model.getFieldValue(d.row,f,!0);a&&a.length?(b={},l.each(a,function(){bithis.value]=1}),a.length=0):a=h],"boolean"===k.type?o=p?1:0:l.each(c(k.picklistValues),function(a){this.value===p&&(o=a)}),(o||0===o)&&l.each(c(j.picklistValues),function(){g(o,this.validFor)&&(!b||this.value in b)&&a.push(this)})}}return a?a:this.metadata.picklistEntries},f.prototype.addOrReplaceConditionsForLookupFiltersToModel=function(b){var c=this,d=t],e=c.options&&c.options.filters?c.options.filters:!1;return b||(b=c.model),e&&e.length&&l.each(e,function(e,f){var g,h,i=c.id+"_"+f.field+"_"+e,j=b.getConditionByName(i);if(j||(j=new a.model.Condition,j.name=i,b.addCondition(j)),j.field=f.field,j.operator=f.operator||"=",j.encloseValueInQuotes=f.encloseValueInQuotes,g=n.isMultiValueOperator(j.operator),"dependent"===f.type)h=c.model.getFieldValue(c.row,f.depfield,!0),"undefined"!=typeof h&&(g?j.values=h&&-1!=h.indexOf(";")?h.split(";"):th]:j.value=h),j.type="fieldvalue";else if("param"===f.type)h=a.page.params.f.mergeField],"undefined"!=typeof h&&(g?j.values=h&&-1!=h.indexOf(";")?h.split(";"):th]:j.value=h),j.type="fieldvalue";else if("modelmerge"===f.type){var k=a.model.getModel(f.mergeModel);k&&(g?(j.values=v],l.each(k.data,function(){j.values.push(k.getFieldValue(this,f.mergeField,!0))})):j.value=k.getFieldValue(k.getFirstRow(),f.mergeField,!0),j.type="fieldvalue")}else j.type=f.type,f.values?j.values=f.values:j.value=f.value,f.mergeField&&(j.mergeField=f.mergeField,j.originalValue=null);d.push(j)}),d};var y=function(a){if(a&&a.length){var b={];return a.children().each(function(){var a=l(this),c="false"!==a.attr("enclosevalueinquotes"),d={field:a.attr("field"),type:a.attr("type"),operator:a.attr("operator"),value:a.attr("value"),depfield:a.attr("depfield"),encloseValueInQuotes:c};if("multiple"==d.type){d.values=v];var e=a.children("values");e.length&&e.first().children("value").each(function(){var a=n.getXML(this);a.length>8?(a=n.decodeXML(a.substring(7,a.length-8)),d.values.push(n.adjustValueBasedOnQuotedness(a,c))):d.values.push("")})}else"userinfo"==d.type?d.mergeField=a.attr("userinfotype"):"param"===d.type?d.mergeField=a.attr("value"):"modelmerge"===d.type&&(d.mergeField=a.attr("mergefield"),d.mergeModel=a.attr("model"));b.push(d)}),b}};g.prototype.setOriginalValue=function(a){"undefined"==typeof this.element.data("originalValue")&&this.element.data("originalValue",a)},g.prototype.restoreOriginalValue=function(){var a=this,b=a.element,c=b.data("originalValue");if(a.isMultiselect&&!a.isReferenceFilter){if(b=b.find("select"),"__reset"===c)b.val("");else if(c){var d=c.split(";");l.each(b.children("option"),function(a,b){l(b).prop("selected",l.inArray(b.value,d)>-1)})}b.data("echMultiselect")&&b.multiselect("refresh")}else"undefined"!=typeof c&&("toggle"===a.type?b.toggleClass("disabled",c):"daterange"===a.type?a.updateDisplayValue(c.start,c.end):a.isReferenceFilter?b.actionAutocomplete("resetItem",c):c&&"undefined"!=typeof c.value&&(a.element.is(".nx-actionautocomplete")?b.actionAutocomplete("resetItem",c.value):b.actionSelect("selectItem",c,{triggerHandlers:!1})))},g.prototype.isSelectedFromEffects=function(b){var c=this,d=!1;return b.each(function(){var b=l(this),e=c.affectedConditionsdb.attr("condition")];if(e)if("deactivate"===b.attr("action")){if(!e.inactive)return d=!1,!1}else if("set"===b.attr("action")){var f=a.utils.mergeAsText("global",b.attr("value")||"",{createFields:!0,registerFields:!1});if(f!==e.value||e.inactive)return d=!1,!1}else if("activate"===b.attr("action")&&e.inactive)return d=!1,!1;d=!0}),d},g.prototype.resetAffectedConditions=function(){var a=this;l.each(a.affectedConditions,function(){a.model.resetCondition(this,a.affectCookies)})},g.prototype.applyFilterForItem=function(b){var c,d=this,e=t],f=b.effects,g=b.source,h=g&&g.effects,i=b.affectDefaultCondition;if(f&&f.length&&l.each(f,function(){e.push(this)}),h&&h.length&&l.each(h,function(){e.push(this)}),c=e&&e.length,c&&l.each(e,function(){var c=l(this),e=d.affectedConditionsdc.attr("condition")];if(e)if("deactivate"===c.attr("action"))d.model.deactivateCondition(e,d.affectCookies);else if("set"===c.attr("action")){var f,h={};b.row&&(h.row=b.row),g&&g.model&&(h.model=g.model),c.attr("value")?f=c.attr("value"):b.value&&(f=b.value),f=a.utils.mergeAsTextInContext(f,h,{createFields:!1,registerFields:!1}),d.model.setCondition(e,f,d.affectCookies)}else"activate"===c.attr("action")&&d.model.activateCondition(e,d.affectCookies)}),i&&"undefined"!=typeof b.value&&d.filterCondition)
EDIT: I bolded the 4 occurances of hasChanged in the above. Perhaps that actually useful to someone?
Matt gets the award for sending the most code…
I usually get this error when I have not defined an sObject for a model. Maybe you started to set up a model and then stopped to do somthing else and forgot about it? Happens to me all the time.
My two cents. Don’t think it has anything to do with hasChanged. That’s skuid js and I don’t it’s their js that has a bug. Maybe, but I doubt it.
Does your page models point to any custom objects/fields. If not, I’ll take a look at the page if you want copy the page XML to here.
Rob, all the models have sObjects.
Pat, Thanks… it’s entirely custom objects.
I’m guessing it has something to do with how the models are set up, but I haven’t been able to diagnose.
What’s the last change you made? Assuming this worked before that.
I made some changes early this week to which model would get the url parameter, and reordered the models. But everything seems to be set up the way it should with the models & conditions.
I’d make a clone and start to remove one model at a time to see when the page starts to work again.
Well… that was strange.
I realized that just before I noticed the error, I had added a field editor with a single field.
I removed that field editor, and voila! I worked.
I then added a field editor and the same field back again, and it still works!
So, I remain confused, but I have a working page.
How many lines of xml is the page?
1592
Hi Matt,
We consider any javascript error that comes from our code a problem with Skuid. Even if something is horribly wrong with your XML, Skuid Javascript should give you a nice error. One really cool feature I found recently in Chrome Dev Tools is the “Pretty Print” button on the “Sources” tab.
In the future, if you want to get closer to where the error is happening, click that button and it will turn one line of minified nastiness into lots of lines of slightly more understandable nastiness. I absolutely love that feature though.
Yup. I have no idea.
Sweet. Thanks, Ben!
WOW!!! That button is awesome!!!
this whole thread is so helpful! i the Skuid community!
I just wanted to add to the conversation that i got this same error. The cause was from deleting a model. The table that was based on the model went away. And when i looked in the UI to change the models saved from my Save button on the page, the removed model was no longer listed there. However, when l looked at the XML, the deleted model was still in the XML to be updated by the save button. So I wanted to report this mismatch between the XML and the UI! If you have more questions or need clarification, let me know.
Thanks Rebecca. Great sleuthing! I’ll pass the issue along.
Just a note that I ran into the same issue as Rebecca. Removing a model in the builder does not remove it from lists of models behind pagetitle save/cancel buttons.
Hmm. This does not happen for me any longer? ARe you on the latest version of Skuid? Check out Get the Latest Skuid Releases & Everything That Came Before
Nope, looks like I was on the previous patch. Thanks!
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.