Customer is requesting an answer by Wednesday (3/25), any help would be sincerely appreciated.
Attached is a barebones Cordova project that works on TC55KK with Datawedge. I am looking at differences and why there application is not working. Stay tuned. Possibly the keyboard plugin they are using is getting in the way.
dwCordovaTest.zip 9.4 MB
Some more findings:
Results in a scan, but only one character is pasted
Leaving that commented and then commenting out:
Has scanning working with all characters being put in text box
Then oddly putting the mqttws31.js back in but leaving the ASC_Constants.js file commented - chops off the first character
I have no idea why it is different from JB to KK, but it is possible that these libraries behave differently on KK - Looks like they are responsible for some type of processing of keyboard input,
In all of my testing so far the SIP opens - I will look at that next to demonstrate how to hide it
Sorry actually - commenting out the onkeydown="onKeyPress(event)" works fine.
What is it trying to do with each keystroke? Datawedge sends each character one at a time, so each digit in the barcode will trigger this event. I would suggest that you do some processing after the value changes.
If you are trying to ensure that the barcode is meeting a certain pattern there are much better ways to do this with Angular using ng-message and the use of $invalid, $dirty, $pristine.
Thanks Rob, i don't understand the reasons behind their code base. Would it be possible for you to join a quick call with them on Wednesday Mar 25 at 10 am central?
I think they're just looking for a bit of direction and they'll handle the rest.
here is an updated sample of hiding the SIP after it appears. I do not see a way of preventing it from popping up selectively for fields.
dwCordovaHideSIP.zip 9.4 MB
I will explain issue in brief:
Our requirement is to build a hybrid application with agnostic code that will do the following:
- Multiple screens will have requirement to capture barcode by pressing the hardware scanner button in TC 55.
- These barcodes can be one per screen or multiple per screen.
- These screens will have text boxes or text areas only for manually providing input.
- 1 barcode per screen will be shown in a text box & multiple barcode per screen will be shown in text area with a delimiter.
- As per usability design when the screens load, the text box/text area will not have focus. However user can still scan the barcode value & that value should appear in the text box. This is a must have feature.
- The decoded barcode value is being put into the text boxes & text areas to provide the user to manually modify the value. This will be a rare scenario & normally users won’t be required to do that.
The code that is being shared was working perfectly in Jellybean. With the keypress event, we were able to capture the barcode value one at a time with keyCode attribute. This keyCode value in Kitkat is coming as 0.
If you find solution for the problem, share with Marcela. She will drop a mail to us.
Edit: I have modified the sample code. Please find it attached.
BarcodeIssue.zip 1.3 MB
Thanks for sharing the information - that helps me understand why you are doing it this way. This does boil down to a change in the Webview that is being used in KitKat. In 4.4, Google switched to Chromium and thus has inherited any issues with it. You can actually simulate the problem without Datawedge in the picture by capturing the keyCode as you type in an input field and output the keyCode, you will see it is all '0's. Here are a few links that talk about this issue:
an option could be to use the opensource Cordova plugin to integrate with DataWedge Intent:
In this way you can receive the data as an Intent instead of having to rely on the keyPress events that, as Rob wrote, are broken since Android v4.4 using the system webview.