From b5e70f88ae2d22f9c98b78ab258990a74af67fec Mon Sep 17 00:00:00 2001 From: Steve Hackbarth Date: Thu, 18 Sep 2014 16:08:54 -0400 Subject: [PATCH] display barcode misfires --- lib/enyo-x/source/en/strings.js | 1 + lib/enyo-x/source/views/transaction_list.js | 7 ++++++- .../source/views/transaction_list_container.js | 13 +++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/enyo-x/source/en/strings.js b/lib/enyo-x/source/en/strings.js index 18236bfff..bd06bbe19 100644 --- a/lib/enyo-x/source/en/strings.js +++ b/lib/enyo-x/source/en/strings.js @@ -139,6 +139,7 @@ strict:true, trailing:true, white:true */ "_noDescription": "No Description", "_noDocumentFound": "No Document Found.", "_noEligibleActions": "No Eligible Actions", + "_noItemFound": "No item found", "_noOldPassword": "Please enter your old password", "_unsavedChanges": "You have unsaved changes.", "_saveYourWork?": "Do you want to save your work?" diff --git a/lib/enyo-x/source/views/transaction_list.js b/lib/enyo-x/source/views/transaction_list.js index 99ea88722..e371c11e0 100644 --- a/lib/enyo-x/source/views/transaction_list.js +++ b/lib/enyo-x/source/views/transaction_list.js @@ -24,7 +24,8 @@ trailing:true, white:true, strict:false*/ events: { onProcessingChanged: "", onOrderChanged: "", - onShipmentChanged: "" + onShipmentChanged: "", + onUpdateHeader: "" }, handlers: { onBarcodeCapture: "captureBarcode" @@ -48,7 +49,11 @@ trailing:true, white:true, strict:false*/ }); if (models.length > 0) { this.transact(models, true, true); + } else { + inEvent.noItemFound = true; } + + this.doUpdateHeader(inEvent); }, /** Helper function for transacting `transact` on an array of models. diff --git a/lib/enyo-x/source/views/transaction_list_container.js b/lib/enyo-x/source/views/transaction_list_container.js index f1b9ac39c..2116df4d1 100644 --- a/lib/enyo-x/source/views/transaction_list_container.js +++ b/lib/enyo-x/source/views/transaction_list_container.js @@ -33,7 +33,8 @@ trailing:true, white:true, strict:false*/ onListItemMenuTap: "showListItemMenu", onParameterChange: "requery", onProcessingChanged: "processingChanged", - onSelectionChanged: "selectionChanged" + onSelectionChanged: "selectionChanged", + onUpdateHeader: "updateHeader" }, init: false, components: [ @@ -48,7 +49,7 @@ trailing:true, white:true, strict:false*/ {kind: "onyx.Menu", name: "actionMenu"} ]} ]}, - {classes: "xv-header", content: "_search".loc()}, + {classes: "xv-header", name: "transactionListHeader", content: "_search".loc()}, {kind: "XV.ScrollableGroupbox", name: "parameterScroller", classes: "xv-search-container", fit: true} ]}, {name: "listPanel", kind: "FittableRows", components: [ @@ -270,6 +271,14 @@ trailing:true, white:true, strict:false*/ for (i = 0; i < collection.length; i++) { collection.at(i).transactionDate = transDate; } + }, + updateHeader: function (inSender, inEvent) { + if (inEvent.noItemFound) { + this.$.transactionListHeader.setContent("_noItemFound".loc() + ": " + inEvent.data); + + } else if (this.$.transactionListHeader.getContent() !== "_search".loc()) { + this.$.transactionListHeader.setContent(""); + } } }; -- 2.39.2