when IDL class is not defined, load it inline instead of throwing exceptions. *tips...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Sep 2010 17:02:16 +0000 (17:02 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 15 Sep 2010 17:02:16 +0000 (17:02 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@17698 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/dojo/openils/widget/AutoWidget.js

index fd0d0ed..801c824 100644 (file)
@@ -63,7 +63,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
             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 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
             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;
 
index 66ac5de..cb04206 100644 (file)
@@ -20,8 +20,8 @@ if(!dojo._hasResource['openils.widget.AutoWidget']) {
             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();
         },