cancel
Showing results for 
Search instead for 
Did you mean: 

Mobile WD. BarCodeReader getting error when mapping barCode to variable.

Former Member
0 Kudos

Hello experts, I'm having problems to use Mobile WebDynpro with a Symbol device (MC3000), I am using Naurtech CDTerm as Web Browser because I don't have a license to Pocket Browser, according to SAP Note 894627 this browser is also supported.

The problem I am having is when I read a bar code. I get the next exception:

IWDIllegalArgumentException: Parameter barCode not found.

My code looks like this:

public static void wdDoModifyView(IPrivateTest2_view wdThis, IPrivateTest2_view.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
  {
    //@@begin wdDoModifyView
	if (firstTime) {
	   IWDBarCodeReader barCodeReader = (IWDBarCodeReader) view.getElement("BarCodeReader");
	   barCodeReader.mappingOfOnRead().addSourceMapping(IWDBarCodeReader.IWDOnRead.BAR_CODE,"scanData");
 	}
    //@@end
  }

  //@@begin javadoc:onActionDoRead(ServerEvent)
  /** Declared validating event handler. */
  //@@end
  public void onActionDoRead(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String scanData )
  {
    //@@begin onActionDoRead(ServerEvent)
    wdContext.currentContextElement().setData(scanData);
    //@@end
  }

The problem is on the mappingOfOnRead().addSourceMapping() method... I have already tried using "barCode", "data" or as shown on the code, the constant that relates the bar code. The error is always the same, I have been reading similar posts but I haven't figured out any solution, please any comment or guidance will be appreciated.

HELP!!!!

Thanks in advance.

JV

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello, does anybody has run in this situation, please provide feedback... I'm stuck in this problem.

Thanks in advance

Former Member
0 Kudos

Hi,

Did you try the solution provided in following thread

I hope it solves your error

Former Member
0 Kudos

Thank you Aishwarya, I had already checked on that post, as I said.. the parameters I have used so far in the addSourceMapping(x,y) method are "data", "barCode" or the constant IWDBarCodeReader.IWDOnRead.BAR_CODE... none of them seem to work.

I ran out of sources to ckeck, there is very few documentation about the this topic. I hope you have any other idea? Maybe I am doing something wrong... The parameter "barCode", "data" shouldn't be a context attribute, rigth?