Hi friends,
I'm trying to solve the following situation. I use Enterprise Browser as a client for WMS system. For scanning barcodes I use DataWedge as keystroke output with autoEnter. I have no way to edit server-side code, so I did several customization using DOM injection, e.g. custom sound and vibrations notifications, showing/hiding Enterprise Keyboard on TC8000, remapping hardware buttons on MC33, etc. I also managed to put cursor into Input field when scanning data.
Right now I have another challenge. I need to manipulate scanned barcode before it is send to WMS client. Let's say I scan GS1 Datamatrix, which I need to parse, process some data from this code independently of the WMS, then send only GTIN to the WMS. Everything with just pressing the trigger. I was able to switch DataWedge to Intent output mode, I can catch the intent in EB, I can also parse scanned barcode and put the GTIN into Input field in WMS. I only miss the last step - pressing ENTER in the Input field programatically.
I was looking for some "sendKey" API, similar to buttonBar API, but found nothing. I was also thinking about creating invisible button bar with "ENTER" button and press this button, but I found no API call for this either. I was looking for generic JavaScript code to emulate keypress, but with no luck.
Does anyone have some idea how to achieve this? Basically I need to send ENTER key to the Input field as if I press the key on the keyboard.
Thank you in advance for any help.
Martin
2 Replies
Hi, I thought this was possible with JavaScript? I see a few SO posts like this one: javascript - Simulate pressing [enter] key on input text - Stack Overflow . Have I misunderstood?
Hi Martin, I'm in a similar situation, so can you describe a few things you achieved already?
How did you inject custom sounds and vibration (especially curious about bad scan)?
Also, my biggest struggle is to get focus on the first text field when EB is opened for the first time. In my case, it needs to be tapped once on the text field to be focused and only then I'm able to write in that field. Otherwise, the whole screen becomes blue highlighted.
I'll be super thankful for your response!