display barcode misfires
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 18 Sep 2014 20:08:54 +0000 (16:08 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Thu, 18 Sep 2014 20:08:54 +0000 (16:08 -0400)
lib/enyo-x/source/en/strings.js
lib/enyo-x/source/views/transaction_list.js
lib/enyo-x/source/views/transaction_list_container.js

index 18236bf..bd06bbe 100644 (file)
@@ -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?"
index 99ea887..e371c11 100644 (file)
@@ -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.
index f1b9ac3..2116df4 100644 (file)
@@ -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("");
+      }
     }
   };