[open-ils-commits] r12170 - trunk/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Feb 13 11:14:42 EST 2009


Author: erickson
Date: 2009-02-13 11:14:40 -0500 (Fri, 13 Feb 2009)
New Revision: 12170

Modified:
   trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
func comments, treat "" as null

Modified: trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2009-02-13 14:19:03 UTC (rev 12169)
+++ trunk/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2009-02-13 16:14:40 UTC (rev 12170)
@@ -40,10 +40,14 @@
         },
 
         /**
-         * Turn the value from the dojo widget into a value oils understands
+         * Turn the widget-stored value into a value oils understands
          */
         getFormattedValue : function() {
             var value = this.baseWidgetValue();
+
+            /* text widgets default to "" when no data is entered */
+            if(value == '') return null; 
+
             switch(this.idlField.datatype) {
                 case 'bool':
                     return (value) ? 't' : 'f'
@@ -60,6 +64,9 @@
             return this.widget.attr(attr);
         },
         
+        /**
+         * Turn the widget-stored value into something visually suitable
+         */
         getDisplayString : function() {
             var value = this.widgetValue;
             switch(this.idlField.datatype) {



More information about the open-ils-commits mailing list