added a bool widget for selecting true/false
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 9 Oct 2006 19:20:52 +0000 (19:20 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 9 Oct 2006 19:20:52 +0000 (19:20 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6423 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/reports/oils_rpt_param_editor.js
Open-ILS/web/reports/oils_rpt_widget.js

index 7783f11..b29457b 100644 (file)
@@ -176,6 +176,13 @@ oilsRptParamEditor.prototype.buildWidget = function(param, node) {
                        break;
        }
 
+       switch(dtype) {
+               case 'bool':
+                       atomicWidget = oilsRptBoolWidget;
+                       break;
+       }
+
+
        switch(param.op) {
                case 'in':
                case 'not in':
index 5b52ba1..8bc9428 100644 (file)
@@ -374,6 +374,36 @@ oilsRptTextWidget.prototype.getDisplayValue = function() {
 
 
 /* --------------------------------------------------------------------- 
+       Atomic bool input widget
+       --------------------------------------------------------------------- */
+function oilsRptBoolWidget(args) {
+       this.node = args.node;
+       this.selector = elem('select');
+       insertSelectorVal(this.selector, -1,'True','t');
+       insertSelectorVal(this.selector, -1,'False','f');
+}
+
+oilsRptBoolWidget.prototype.draw = function() {
+       this.node.appendChild(this.selector);
+}
+
+/* returns the "real" value for the widget */
+oilsRptBoolWidget.prototype.getValue = function() {
+       return getSelectorVal(this.selector);
+}
+
+/* returns the label and "real" value for the widget */
+oilsRptBoolWidget.prototype.getDisplayValue = function() {
+       var val = getSelectorVal(this.selector);
+       var label = 'True';
+       if (val == 'f') labal = 'False';
+       return { label : label, value : val };
+}
+
+
+
+
+/* --------------------------------------------------------------------- 
        Atomic calendar widget
        --------------------------------------------------------------------- */
 function oilsRptCalWidget(args) {
@@ -505,7 +535,7 @@ oilsRptAgeWidget.prototype.getDisplayValue = function() {
        --------------------------------------------------------------------- */
 function oilsRptNumberWidget(args) {
        this.node = args.node;
-       this.size = args.size || 24;
+       this.size = args.size || 32;
        this.start = args.start;
        /*
        var len = new String(this.size).length;