ZK - Open Source Ajax Java FrameworkZK - Open Source Ajax Java Framework

ZK and Barcode Reader Device

aktejo
16 Nov 2011 01:45:05 GMT
16 Nov 2011 01:45:05 GMT

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

twiegandTop Contributor
16 Nov 2011 16:14:47 GMT
16 Nov 2011 16:14:47 GMT

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

aktejo
16 Nov 2011 23:51:01 GMT
16 Nov 2011 23:51:01 GMT

Yeah,. thanks todd for the information, finally i understand about how the device work, just like keyboard, i just need to set focus to particular form before read information from the reader.

crc83
22 Nov 2011 10:31:02 GMT
22 Nov 2011 10:31:02 GMT

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

UmbraNoctis
2 Dec 2011 20:13:34 GMT
2 Dec 2011 20:13:34 GMT

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();
				}
			}
			*/
		}
	 }		

which is executed when a the Insert key is presed...

Can someone point me in the right direction?

Iris
22 Feb 2012 03:07:40 GMT
22 Feb 2012 03:07:40 GMT

Hey aktejo,
I find this page by chance. i'm studying some features about barcode, your question is the one i've met before. thanks for twiegand's answers.