changeset 3cb282fef424 in sao:5.8
details: https://hg.tryton.org/sao?cmd=changeset;node=3cb282fef424
description:
        Test instance to clear search form entries

        Since rev 2e49820602fb the entries have no more a type attribute.

        issue9920
        review322811002
        (grafted from bb0c84a990b2820a6cb30458463eedbfa439f821)
diffstat:

 src/screen.js |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (27 lines):

diff -r a1bb8e440d71 -r 3cb282fef424 src/screen.js
--- a/src/screen.js     Sun Dec 06 18:26:31 2020 +0100
+++ b/src/screen.js     Wed Dec 16 21:28:04 2020 +0100
@@ -561,17 +561,12 @@
             if (this.last_search_text.trim() !== this.get_text().trim()) {
                 for (var j = 0; j < this.search_form.fields.length; j++) {
                     var fentry = this.search_form.fields[j][1];
-                    switch(fentry.type) {
-                        case 'selection':
-                            fentry.set_value([]);
-                            break;
-                        case 'date':
-                        case 'datetime':
-                        case 'time':
-                            fentry.set_value(null, null);
-                            break;
-                        default:
-                            fentry.val('');
+                    if (fentry instanceof Sao.ScreenContainer.Selection) {
+                        fentry.set_value([]);
+                    } else if (fentry instanceof Sao.ScreenContainer.Between) {
+                        fentry.set_value(null, null);
+                    } else {
+                        fentry.val('');
                     }
                 }
                 this.search_form.fields[0][2].focus();

Reply via email to