1 Reply Latest reply on Oct 31, 2013 5:33 AM by Daniel Silva

    Bar Codes Values Getting Appended

      Hello All,


      In our project we are trying to scan bar codes from files. We are using Rhos Studio 2.x.


      Now the issue that we are facing is when a bar code is read the cursor stays there and when the scanning is done fast more than one bar code is read, in the same field,and gets appended. The integrated bar codes looks as if it is a single bar code.


      I tried using the below code(first line to remove auto rotatiosn which is working fine.)


      <% if System::get_property('is_motorola_device')%>

      screenOrientation.autoRotate= "disabled";

      scanner.autoEnter= "enabled";



      This too did not work.

      However, rhomobile doc syas  autoEnter can not be used when we use decodeEvent. In our code we are using decodeEvent.

      Can that be the reason autoEnter did not work? What can be the other option?




      Could you please suggest what can be done to ensure tha only scode is read and once tha bar code is read the cursor should move to next field and also the field should get cleared after reading the bar code.

      Also, the change should not impact the performance of the application.


      Please sugegst.


      Thanks a lot in advance!



        • Re: Bar Codes Values Getting Appended
          Daniel Silva

          If you are using the decode event, then the scan data goes directly to your callback function (either in ruby or javascript, whichever you are using), it does not directly interact with the HTML page, so it does not matter what field has focus.  If you are seeing the scanned data in a textbox, that is probably coming from a javascript function.  You could try disabling the scanner at the very beginning of that callback function, and enabling when you are done processing the barcode, but I think that this will cause a performance hit (that takes some time).  Take a look at this post.




          This was written about the SB1, but I think it would probably help you here also.  Not sure if the illumination mode mentioned will work (especially if you are using a laser scanner), but disabling all decoders will essentially prevent the user from scanning another barcode.  The scanner might still light up when they pull the trigger, but it will not be able to decode a barcode.