a month ago
i am using the sap.ndc.BarcodeScannerButton and when the user is pressing the button the barcodescanner will open as it is supposed to be. if the user press the back button of the browser / the phone the view navigates to the view before. in the browser this is ok but on the phone the user feels it would be normal to close the barcodescanner with the backbutton of the phone and it should stay on the view where the button is. But even worse: when i navigate again to the view with the button and press it, the barcodescanner is not opening anymore and this error apperas in the console:
BarcodeScanner.scan: Barcode scanning is already in progress. -
i tried several workarounds but nothing is working. i tried to deactivate the backbutton while the barcodescanner is open, but thats not working in modern browsers anymore. My best attempt was to close the barcodescanner before leaving the view, so it could at least open again, when trying again, but i could not successfully close it. i tried with document.getElementsByClassName('closeButton')[0].click() but it was not working.
any idea?
Request clarification before answering.
So this is not changing anything about the back-button functionality. But i found out, i can call this:
if (sap.ndc && sap.ndc.BarcodeScanner) {
sap.ndc.BarcodeScanner.closeScanDialog();
}
each time the user is leaving (or entering) the view and then the barcodescannerbutton is working again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
64 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.