1 Reply Latest reply on Jan 25, 2017 9:39 AM by Saad Nisar

    Barcode API "autoEnter" property is not honored in Android when Android wakes

    Saad Nisar

      We are facing very strange result in Android. Our application and set of text boxes that needs to be scanned we have set application to focus to next text box when "Enter" key is pressed. Since our SOP is to not let operators touch the screen during this process, we set "EB.Barcode.autoEnter = true" which works fine until Scanner sleeps and awakes again.

      We are using Android MC9200

       

      Following is the test code which proves (when tested on Android) that "EB.Barcode.autoEnter = true " is not being honored when android awakes.

       

       

      <!DOCTYPE html>

      <html>

      <head>

      <script type="text/javaScript" src="/js/jquery.min.js"></script>

      <script type="text/javaScript" src="/js/ebapi-modules.js"></script>

      </head>

      <body>

      <div id="Message" >

          Text1 :<input type="text" class="inputs" id="firstItem" />

          <br>

          Text2 :<input type="text" class="inputs"/>

          <br>

          Text3 :<input type="text" class="inputs"/>

      </div>

      <script type="text/javascript">

         

          function EnableScanner(enabled) {

                  if(enabled) {

                      try {                      

                              EB.Barcode.autoEnter = true;

                              EB.Barcode.enable();                   

         

                       } catch (e) { alert(e.message); }

                   }

                   else { try { EB.Barcode.disable(); } catch (ex) { alert(ex.message); } }  

           }

          

         

       

       

          $(document).ready(function(){

                EnableScanner(true);

                $('.inputs').keydown(function (e) {

                    if (e.which === 13) {

                         var index = $('.inputs').index(this) + 1;

                        $('.inputs').eq(index).focus();

                    }

               });  

               $("#firstItem").focus();       

          });   

         

      </script>   

      </body>

      </html>