[open-ils-commits] r16444 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon May 17 15:57:09 EDT 2010
Author: erickson
Date: 2010-05-17 15:57:04 -0400 (Mon, 17 May 2010)
New Revision: 16444
Modified:
trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
don't assume an autofieldwidget cached linked object list contains the linked object in question. it may have been filtered out of the original list
Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-05-17 19:57:03 UTC (rev 16443)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js 2010-05-17 19:57:04 UTC (rev 16444)
@@ -288,10 +288,8 @@
return false;
var lclass = linkInfo.linkClass;
- if(lclass == 'aou') {
- this.widgetValue = fieldmapper.aou.findOrgUnit(this.widgetValue).shortname();
- return;
- }
+ if(lclass == 'aou')
+ return false;
// first try the store cache
var self = this;
@@ -299,12 +297,17 @@
var store = this.cache[this.auth].list[lclass];
var query = {};
query[linkInfo.vfield.name] = ''+this.widgetValue;
+ var found = false;
store.fetch({query:query, onComplete:
function(list) {
- self.widgetValue = store.getValue(list[0], linkInfo.vfield.selector);
+ if(list[0]) {
+ self.widgetValue = store.getValue(list[0], linkInfo.vfield.selector);
+ found = true;
+ }
}
});
- return;
+
+ if(found) return;
}
// then try the single object cache
More information about the open-ils-commits
mailing list