From 40f1fb2cea5a54da20497f1c89bee21a753de127 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 11 Aug 2014 11:04:43 -0400 Subject: [PATCH] LP#1329503 text input repairs * Correctly propagate values for text widget "in list" values when editing reports * After entering a value for "in list" text widgets, clear the text input so the user can enter subsequent values w/o manually clearing. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/web/reports/oils_rpt_widget.js | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/reports/oils_rpt_widget.js b/Open-ILS/web/reports/oils_rpt_widget.js index 2937e9ef15..f71108941a 100644 --- a/Open-ILS/web/reports/oils_rpt_widget.js +++ b/Open-ILS/web/reports/oils_rpt_widget.js @@ -23,6 +23,10 @@ oilsRptSetWidget.prototype.draw = function() { var obj = this; this.addButton.onclick = function() { obj.addDisplayItems(obj.inputWidget.getDisplayValue()); + if (obj.inputWidget instanceof oilsRptTextWidget) { + // clear the value + obj.inputWidget.dest.value = ''; + } } this.delButton.onclick = function(){obj.removeSelected()}; @@ -31,9 +35,21 @@ oilsRptSetWidget.prototype.draw = function() { var this_ = this; var post_draw = function() { - // propagate the values from the input widget into the our display. - if (this_.inputWidget.seedValue) - this_.addButton.onclick(); + if (this_.seedValue && this_.seedValue.length) { + if (this_.inputWidget instanceof oilsRptTextWidget) { + // add each seed value to the input widget, then + // propagate the value into our multiselect. + // when done, clear the value from the text widget. + dojo.forEach(this_.seedValue, function(val) { + this_.inputWidget.dest.value = val; + this_.addButton.onclick(); + }); + this_.inputWidget.dest.value = ''; + + } else { + this_.addButton.onclick(); + } + } } this.inputWidget.draw(null, post_draw); -- 2.43.2