
6

SAP MDK OnValueChange event issue
source link: https://community.sap.com/t5/technology-q-a/sap-mdk-onvaluechange-event-issue/qaq-p/13617454
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

SAP MDK OnValueChange event issue
Hi Experts,
I am using a Android based TC72 device which has a inbuilt scanner.
My requirement is, in a page have a SimpleProperty with OnValueChange calling a rule.
When a user scans a barcode, I have to show an alert and clear the Input Field for next scan.
Issue : Its working for the first time as expected but second time its still retaining the first scan value. (I am scanning two different barcodes alternatively for testing) So my OnValueChange triggering twice. (one with OLD value and again with NEW value).
My Rule Code inside the default function as below
var scannedValue = clientAPI.getValue();
alert("Scanned Value first time :" + scannedValue + ":");
clientAPI.setValue("", false); // Doing this to stop second call to the event
alert("Scanned Value second time :" + clientAPI.getValue() + ":"); // this is still showing the value
</div
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK