[open-ils-commits] r17698 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Wed Sep 15 13:02:20 EDT 2010
Author: erickson
Date: 2010-09-15 13:02:16 -0400 (Wed, 15 Sep 2010)
New Revision: 17698
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js
Log:
when IDL class is not defined, load it inline instead of throwing exceptions. *tips hat to miker*
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-09-15 16:34:56 UTC (rev 17697)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-09-15 17:02:16 UTC (rev 17698)
@@ -63,7 +63,7 @@
this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass];
if(this.fmClass && !this.fmIDL)
- throw new Error("IDL class '" + this.fmClass + "' not defined");
+ fieldmapper.IDL.load([this.fmClass]);
this.suppressLinkedFields = args.suppressLinkedFields || [];
@@ -364,7 +364,7 @@
var linkClass = this.idlField['class'];
if(this.idlField.reltype != 'has_a') return false;
if(!fieldmapper.IDL.fmclasses[linkClass]) // class neglected by AutoIDL
- throw new Error("IDL Class '" + linkClass + "' not defined");
+ fieldmapper.IDL.load([this.fmClass]);
if(!fieldmapper.IDL.fmclasses[linkClass].permacrud) return false;
if(!fieldmapper.IDL.fmclasses[linkClass].permacrud.retrieve) return false;
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js 2010-09-15 16:34:56 UTC (rev 17697)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoWidget.js 2010-09-15 17:02:16 UTC (rev 17698)
@@ -20,8 +20,8 @@
if(this.fmObject)
this.fmClass = this.fmObject.classname;
this.fmIDL = fieldmapper.IDL.fmclasses[this.fmClass];
- if(this.fmClass && !this.fmIDL)
- throw new Error("IDL class '" + this.fmClass + "' not defined");
+ if(this.fmClass && !this.fmIDL)
+ fieldmapper.IDL.load([this.fmClass]);
this.buildSortedFieldList();
},
More information about the open-ils-commits
mailing list