7 Replies Latest reply on Apr 3, 2018 12:34 AM by Darryn Campbell

    Setting properties

    David Garratt

      I have tried limiting the scanner to only code 128 / ean 128 barcodes but doing the following on the page load event results in the scanner being enabled but not reading any codes.

       

              function enableScanners(){

                   EB.Barcode.enable({'allDecoders': false,'code128ean128':true}, scanReceived);

              }

       

       

      Am I doing something wrong.

       

      It would be nice to see some more code examples as I"m sure I saw somewhere allDecoders used in conjunction with enabled rather than true.

       

      Also tried this syntax

       

              function enableScanners(){

                   EB.Barcode.enable({allDecoders:false,code128ean128:true}, scanReceived);

              }

        • Re: Setting properties
          Darryn Campbell

          Hi David,

           

          Code128Ean128 is just a boolean flag set to handle some very specific barcode conversion to EAN128.

           

          You need to enable Code128 (Barcode - Zebra Technologies TechDocs ) not code128ean128.  The first syntax should be correct.

           

          There are additional samples at Sample Apps - Zebra Technologies TechDocs  but those do not specifically handle code 128.

            • Re: Setting properties
              David Garratt

              Thanks for the links. I have looked at them. JavaScript is rather unfamiliar to me, being a Java programmer and having used simple <Meta> tags with Pocket Browser until now.

               

              Would you be so kind as to amend my example code above so I have an example, lets say to scan only Code128Ean128 barcodes with a length of 20 characters ?

               

              I was also unclear about the documentation referring to instance objects. I assume if you don't use them then changes are global and not specific to the one web page.

               

              Thanks in advance

               

              Dave

                • Re: Setting properties
                  Darryn Campbell

                  Hi,

                   

                  So, the amended code would be:

                  function scanReceived(dat) {
                      document.getElementById("display").value = dat.data;
                  };
                          function enableScanners(){
                              EB.Barcode.enable({'allDecoders': false,'code128':true}, scanReceived);
                          }
                  

                   

                  Yes, if you don't use instance objects then the changes are global. I'm just looking at the conversation you had with Abhineet over in the other thread, looks like there is a rabbit hole of different techniques but your original issue, that the scannernavigate meta tag did not work, was due to your Config.xml having UseRegularExpressions set to 0, it needed to be set to 1.  You might find the following guide useful: PocketBrowser 2.x/3.x Migration Guide - Zebra Technologies TechDocs , it describes the process of moving from PB2.x to Enterprise Browser on Windows Mobile / CE.  The document is a bit old but that works in our favour here since newer documentation tends to focus exclusively on Android.  So, if you are happier using meta tags then you should be able to just stick with those in Enterprise Browser.

                    • Re: Setting properties
                      David Garratt

                      I've read the link in your reply above, I will recommend the customer makes the change you suggest however once we disabled DataWedge things improved. The document does not explain very well what exactly would be effected by the UseRegularExpressions setting. i.e. What would be broken if I did not change it.

                        • Re: Setting properties
                          Darryn Campbell

                          Yes, it is not entirely obvious from the guide I agree.

                          UseRegularExpressions converts any meta tags (or Javascript calls using the ActiveX object) written in EMML 1.0 to their equivalent EMML 1.1 syntax.  Without this setting any applications running in PocketBrowser 3, RhoElements 1.0, RhoElements Shared Runtime or Enterprise Browser need to be written to be compliant with EMML 1.1.  With this setting the mentioned applications will understand both EMML 1.0 and EMML 1.1.

                           

                          EMML 1.0 was used in PocketBrowser 1.x and 2.x

                          EMML 1.1 was introduced in PocketBrowser 3.0

                           

                          For a more detailed explanation of the differences between EMML 1.0 and EMML 1.1 then please see - Zebra Technologies TechDocs (but ignore the bit about EMML profiles).

                            • Re: Setting properties
                              David Garratt

                              Would you say there are any down sides to enabling this UseRegularExpressions flag. I use meta tags in my web app and they appear to work but if I'm not in danger of breaking anything else then I will recommend the customer sets this flag as you suggest.

                               

                              Thanks again

                               

                              Dave

                                • Re: Setting properties
                                  Darryn Campbell

                                  Yes, they can slow down full page loads, in the region of less than a second but it depends on how many full page navigations happen in the course of using your application.  I would recommend you have a trial period first.  If you have not noticed already it then that is a good sign .  There are no other down sides - the page load time is the only reason they were disabled by default.