Atozed Forums
JavaScript How To?? - Printable Version

+- Atozed Forums (https://www.atozed.com/forums)
+-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html)
+--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html)
+---- Forum: English (https://www.atozed.com/forums/forum-16.html)
+----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html)
+----- Thread: JavaScript How To?? (/thread-1994.html)

Pages: 1 2


JavaScript How To?? - ShaneStump - 09-22-2020

Howdy All!

I am in the process of trying to add a version of my barcode scanner routine (keyboard handler) into my IW app. 

What I need to do is keep reading the keyboard (OnChar) and look for a start delimiter and an ending delimiter (or ESC to abort the keyboard read).

In my VCL app, I just put up a modal dialog with a label and a Cancel button and I implement the aforementioned routine trapping the form's OnChar event.

I would like to do something similar in an IW javascript routine.

I really am ignorant when it comes to programming in javascript and I have Googled for hours and can't find anything more than a simple OnKeyDown routine example.

Has anyone an example of how to implement this?

All the best and thanks in advance,

Shane


Mask Edit? - ShaneStump - 09-23-2020

Does anyone have a good library / component that they can reference that can be used for mask edits?

I am trying to solve my aforementioned problem in a different way.

I can't believe how difficult the most simplest things are once one starts to try to get it to work in a browser.

All the best,

Shane


RE: Mask Edit? - Сергей Александрович - 09-23-2020

(09-23-2020, 03:21 AM)ShaneStump Wrote: есть ли у кого-нибудь хорошая библиотека / компонент, на который они могут ссылаться, который можно использовать для редактирования масок?

Я пытаюсь решить свою вышеупомянутую проблему по-другому.

Я не могу поверить, как трудно самые простые вещи, как только начинаешь пытаться заставить их работать в браузере.

Всего наилучшего,

Шейн

Какой сканер вы используете? а в какой среде работает клиентская часть?


RE: JavaScript How To?? - ShaneStump - 09-23-2020

I am open to the scanner as long as it is a 2D imager (no more laser / CCS scanners).

I am just looking for a simple way to extend a barcode scanning IW app I wrote that uses the camera. Most of my users don't understand simple physics / optics and try to use an IPAD to scan QR codes off a phone in bright sun shine (i.e. they think I am a smartass if I tell them to get a big black umbrella).

Any how, I am trying to find a simple mask edit control that works with IW.

All the best,

Shane


RE: JavaScript How To?? - Сергей Александрович - 09-23-2020

I have a Windows client and Metrologic scanners or similar. I have been using this option for a long time: I Place the cursor on the TEdit field and read the barcode into it with the scanner. The scanner is configured to add "carriage return" characters at the end of the barcode. For tDbEdit, in the OnPressKey event, we write processing the entered barcode or switching to the desired procedure. In any case, after that, the entire barcode is in TEdit and you can do anything with it.
It's the same with QR codes !
But it doesn't work under Android right now I'm dealing with this problem.

Did I understand correctly that you work with Android and recognize the barcode image from the device's camera?

How do you get the scan result? In a text string?


RE: JavaScript How To?? - ShaneStump - 09-23-2020

(09-23-2020, 03:38 AM)Сергей Александрович Wrote: I have a Windows client and Metrologic scanners or similar. I have been using this option for a long time: I Place the cursor on the TEdit field and read the barcode into it with the scanner. The scanner is configured to add "carriage return" characters at the end of the barcode. For tDbEdit, in the OnPressKey event, we write processing the entered barcode or switching to the desired procedure. In any case, after that, the entire barcode is in TEdit and you can do anything with it.
It's the same with QR codes !
But it doesn't work under Android right now I'm dealing with this problem.

Did I understand correctly that you work with Android and recognize the barcode image from the device's camera?

How do you get the scan result? In a text string?

I am going to write a BootStrap 4 input wrapper around the following component:

https://github.com/RobinHerbots/Inputmask

Thanks,

Shane


RE: JavaScript How To?? - Сергей Александрович - 09-23-2020

I don't understand what masks have to do with it. Barcodes or QR codes have different structure, length, and composition. In my understanding, you first need to read the barcode into a string variable and then pass this value for processing. That's what I always do.


RE: JavaScript How To?? - kudzu - 09-23-2020

Barcode with IntraWeb

https://www.youtube.com/watch?v=WlvpYDY5u6c


RE: JavaScript How To?? - Сергей Александрович - 09-23-2020

Beautiful! And how to do it?


RE: JavaScript How To?? - ShaneStump - 09-24-2020

(09-23-2020, 02:04 PM)kudzu Wrote: Barcode with IntraWeb

https://www.youtube.com/watch?v=WlvpYDY5u6c

Howdy Big K!

I have had barcode scanning in my web application for quite a while .... the problem is everybody told me how great camera phones are for scanning and let's just say I spent 2 hours on the phone today quiet listening to why they are not....

So I am going to use a MaskEdit routine since my barcodes aren't in a random format and can be masked.... I wish I had enough time and the javascript skills to write a popup dialog class that would read the keyboard and exit when either a valid bar code was scanned in or the user pressed a cancel button (like what I have in my Windows apps).

All the best,

Shane