Hello,
I am developing a WDJ application for Intermec CK61 device on NetWeaver CE 7.1 box. The requirement is to read a 2D barcode and then parse it for display to user via a view. I am using Intermec Browser version 1.01.02.
I have followed [this|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/949f8421-0a01-0010-59ad-f961a4834c13] SAP example. However, when I scan a barcode using the CK61 barcode scanner, the barcode contents do not appear. I can see the onRead event being triggered, then the screen refreshes, then nothing.
I understand onRead has two parameters: barCode and type. Now, in the wdDoModifyView method, the type parameter returns correctly the barcode type to my context (i.e. PDF417) and am able to display it to the user. However, the barCode parameter just won't return anything.
Has anyone experienced this before? Do I need to do anything special to make it work? I provide my code below for wdDoModifyView and the action assigned to the onRead event:
My action has two parameters: scanData and scanType (both Strings) to which I map barCode and type respectively:
public static void wdDoModifyView(IPrivateBarCodeView wdThis, IPrivateBarCodeView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime)
{
IWDBarCodeReader barCodeReader = (IWDBarCodeReader) view.getElement("BarCodeReader_Scan");
barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.BAR_CODE, "scanData");
barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.TYPE, "scanType");
}
//@@end
}
On my view I have two context elements - Data & Type - that I set according to action parameters scanData and scanType respectively. These are both strings and are both bound to TextView elements:
public void onActionScanBarCode(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String scanData, java.lang.String scanType )
{
//@@begin onActionScanBarCode(ServerEvent)
wdThis.wdGetContext().currentContextElement().setData(scanData);
wdThis.wdGetContext().currentContextElement().setType(scanType);
//@@end
}