[open-ils-commits] r9597 - branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget

svn at svn.open-ils.org svn at svn.open-ils.org
Tue May 13 22:47:08 EDT 2008


Author: djfiander
Date: 2008-05-13 22:47:07 -0400 (Tue, 13 May 2008)
New Revision: 9597

Modified:
   branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js
Log:
Wrap initialization code in dojo.addOnLoad() to eliminate timing
bugs with authentication.


Modified: branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js
===================================================================
--- branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js	2008-05-14 02:46:05 UTC (rev 9596)
+++ branches/acq-experiment/Open-ILS/web/js/dojo/openils/widget/FundSelector.js	2008-05-14 02:47:07 UTC (rev 9597)
@@ -4,6 +4,9 @@
 
     dojo.require("dojox.grid.editors");
 
+    dojo.require('fieldmapper.Fieldmapper');
+    dojo.require('fieldmapper.dojoData');
+
     /**
      * This widget provides a specific selector for selecting
      * a fund.
@@ -12,10 +15,6 @@
     dojo.declare("openils.widget.FundSelector", dojox.grid.editors.Select, {
 
 	constructor: function(inCell) {
-	    console.dir(this);
-	    this.store = this.store || this.cell.store;
-	    this.identifier = this.identifier || this.cell.identifier || "id";
-	    this.name = this.name || this.cell.name || "name";
 	    this.options = openils.widget.FundSelector.fundNames;
 	    this.values = openils.widget.FundSelector.fundCodes;
 	}
@@ -24,20 +23,23 @@
     openils.widget.FundSelector.fundNames = [];
     openils.widget.FundSelector.fundCodes = [];
 
-    fieldmapper.standardRequest(
-	['open-ils.acq', 'open-ils.acq.fund.org.retrieve'],
-	{
-	    async: true,
-	    params: [openils.User.authtoken, null, {flesh_summary:1}],
-	    oncomplete: function (r) {
-		var msg;
-		
-		while (msg = r.recv()) {
-		    var f = msg.content();
-		    openils.widget.FundSelector.fundNames.push(f.name());
-		    openils.widget.FundSelector.fundCodes.push(f.id());
-		}
-	    }
-	}
-    );
+    dojo.addOnLoad(
+	function() {
+	    fieldmapper.standardRequest(
+		['open-ils.acq', 'open-ils.acq.fund.org.retrieve'],
+		{
+		    async: true,
+		    params: [openils.User.authtoken, null, {flesh_summary:1}],
+		    oncomplete: function (r) {
+			var msg;
+			
+			while (msg = r.recv()) {
+			    var f = msg.content();
+			    console.dir(f)
+			    openils.widget.FundSelector.fundNames.push(f.name());
+			    openils.widget.FundSelector.fundCodes.push(f.id());
+			}
+		    }
+		});
+	});
 }



More information about the open-ils-commits mailing list