I have an entry form (popup screen) with three fields for Part Number (text entry), Lot Number (text entry), and Quantity (integer entry). The values are scanned from a USB connected bar code reader which inputs as a stdio character stream (same as a keyboard). The barcodes have a carriage return on the end and this is needed for other systems that also use the same barcodes, so I can’t change the barcodes. I need a way to automatically advance focus from one field to the next after each barcode is scanned. Before Ignition I was using a VBA form in the previous HMI and it auto advanced to the next field. Any ideas?
Also, how do I change the tab order of objects on a screen? The present tab order is Part Number, Load Button, Cancel Button, Lot Number, Quantity. I need the order to be Part Number, Lot Number, Quantity, Load button, Cancel button.
if event.propertyName == "text":
if chr(13) in event.newValue or chr(10) in event.newValue:
event.source.parent.getComponent("txt2").requestFocusInWindow()
NOTE TO SELF [size=50](and you since you are reading this)[/size]: PASTING text into a text field does NOT fire the propertyChange event.
Thanks guys. I was working with the Keytyped event but wasn’t getting the syntax right or something, still a little new at this.
Jordan’s code worked on the KeyReleased event. The operators will be glad they don’t have to put the barcode scanner down to touch the screen to change focus now.
I tried Adam’s code too but ended up going with the KeyReleased event instead.
Do you have a similar solution for perspective, too? We are using a USB barcode scanner and the operator does not have access to PC or keyboard and the numeric fields have to advance focus automatically.