-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Dear ZK Experts,
Anybody has idea about how to use barcode reader device to interact with zk application.
I want to display information read by barcode reader device in one of textbox in my ZK Application.
Thanks for help
aktejo,
We use both barcode and RFID readers extensively and haven't had to do anything special for ZK to support them. The hardware device reads the barcode (assuming the symbology is one the device supports), parses it, and gives it back to the application as straight text. The devices generally appear as an HID (Human Input Device) - like a keyboard - to the host.
One thing you might need to configure is whether or not the device appends anything to the scan (such as a tab or enter). Otherwise, the user will have to scan the barcode, then physically navigate to the next field.
Hope that helps,
Todd
I know two types of barcode reader devices:
1. Passes readed sequence as "key press events" (or keyboard like)
2. RS-232 devices
For second type you may need a special program on a customer side, to converd RS-232 data to keycodes (I have one for windows and I can share it with you if you like)
According to this you must deal with barcode readers in the same way as with keyboard input
I'm working on the same idea, I have to capture the keystrokes of a barcode scanner and then parse them;
I have configured the scanner to send an Insert before the reading so as to know when to begin reading, but i'm at a loss as to how I should get the readings and know when to stop.
I've tried setting the focus on a textbox, but the focus itself won't be gained until the listener stops executing thus becoming useless, I've also tried synchronization, and either I didn't do it right or I didn't get the idea.
right now my code is:
public void readCode(){ Tab tab4 = (Tab)Path.getComponent(PATH_VENTANA + "tab4"); if(tab4.isSelected()){ /* Textbox aux = ((Textbox)Path.getComponent(PATH_VENTANA + "txtaux")); aux.setVisible(true); aux.addEventListener("onChanging", new waitListener()); lastinput = new Date(); Thread t = new Thread(new Runnable() { public void run() { synchronized(this){ while(new Date().getTime()- lastinput.getTime()<2000){ } notify(); } } }, "Thread de espera"); t.start(); synchronized(t){ try { t.wait(); Messagebox.show(aux.getValue()); } catch (InterruptedException e) { e.printStackTrace(); } } */ } }
Can someone point me in the right direction?
Asked: 2011-11-16 01:45:05 +0800
Seen: 849 times
Last updated: Dec 26 '13