From 2b7c56dd870fdd598d2ad849913692de58a414d9 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 13 Feb 2009 16:14:40 +0000 Subject: [PATCH] func comments, treat "" as null git-svn-id: svn://svn.open-ils.org/ILS/trunk@12170 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 038a3323ca..a7f967d21d 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -40,10 +40,14 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { }, /** - * 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 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) { return this.widget.attr(attr); }, + /** + * Turn the widget-stored value into something visually suitable + */ getDisplayString : function() { var value = this.widgetValue; switch(this.idlField.datatype) { -- 2.43.2