cancel
Showing results for 
Search instead for 
Did you mean: 

Help- Intermec-IBrowser - input bind to table

Former Member
0 Kudos

Dear all,

My application will capture all the scanned value n store inside a table ( which is tie to a context node ),how shd i assign those values into it? i understand tat for single input,i can do like followings..wat if the scanned value is to input into a table? please advice. thank you.

public static void wdDoModifyView(IPrivateMLTMAppView wdThis, IPrivateMLTMAppView.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("data","scanData");

}

}

//scanData is the scanned value

public void onActionScan(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String scanData )

{

//@@begin onActionScan(ServerEvent)

if(wdThis.wdGetContext().currentContextElement().getData() ==null){

wdThis.wdGetContext().currentContextElement().setData(scanData);

}

//@@end

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hie,the code is syntax error free,but i havent get to try on the handheld yet

was wondering where shd i write the code to display out the contents in the table? here's my code :

IPrivateWithInvNum.ITableElement element = null;

element = wdContext.createTableElement();

if (ScanData.startsWith("M")){

element.setMatno(ScanData);

}else if (ScanData.startsWith("B")){

element.setStrbin(ScanData);

}else if (ScanData.startsWith("Q")){

element.setQty(ScanData);

}else if (ScanData.startsWith("U")){

element.setUom(ScanData);

}

list.add(element);

wdContext.nodeTable().bind(list);

Former Member
0 Kudos

Hi Joan

You can write the code in onActionScan().

Former Member
0 Kudos

hi,finanly i got my handheld wif me to do the testing d..the code seems like wil append one record with only one field filled each time i scanned the data...

any other wya to solve dis problem?

coz for my table,i got 4 fields inside..each time scan,the scan data wl be appointed to a certain field

Former Member
0 Kudos

Hi Joan

I tested the code and it works fine for me. I am adding all the items to list and then displaying it. Even if you scan I think all the items would be added to table.

Former Member
0 Kudos

Hi Joan

Create a node with an element in the context . Everytime you call the onActionScan(), create and add the node element to a collection or an array. Then iterate through the collection and display in the table.

Regards

Former Member
0 Kudos

hi,can u provide me wif some example? or simple coding? thanks

Former Member
0 Kudos

Hi Joan

Create a node named "data" and a node element named "data".

Add this code at the end where we can write java code:

ArrayList list = new ArrayList();

In onActionScan(), add this code

IPrivateMLTMAppView.IDataElement element = null;

element = wdContext.createDataElement();

element.setData(scanData);

list.add(element);

wdContext.nodeData().bind(list);

Regards

Former Member
0 Kudos

hi vid,thx so much for the explanation,i wl get back to u if i hit any error..thx!

Former Member
0 Kudos

hi Vid,

sorry,haf some doubt here,izzit for dis --->Then iterate through the collection and display in the table. i shd do it under the wdDoModifyView ? thx

Former Member
0 Kudos

Hi Joan

As you bind the list to the node I think you need not iterate through the list now.

Just try the code and tell me if any problems

Regards