Hi Experts,
I am trying to create dropdownbox for Currency in B2C scenario in checkout screen.
I am able to capture values from shop admin but unable to place them in Table and ResultData.
It seems the issue is at initializing "com.sap.isa.core.util.table.Table tab" in the following code.
How to initialize Table and capture value in ResultData?
protected ResultData _supportedCurrencies;
public ResultData readSupportedCurrencies(Shop shop)
throws CommunicationException{
if ( _supportedCurrencies == null ){
try{
String supportedCurrencies = (String)shop.getExtensionData(CNpShopExtensionNames.CURRENCIES);
StringTokenizer st = new StringTokenizer(supportedCurrencies, ",");
com.sap.isa.core.util.table.Table tab = _supportedCurrencies.getTable();
int i=1;
String sCurrency = "";
Object rowKey;
TableRow tabRow;
while(st.hasMoreTokens()){
sCurrency = st.nextToken();
rowKey = sCurrency;
tabRow = tab.insertRow();
tabRow.setRowKey((RowKey)rowKey);
tabRow.setValue(i, sCurrency);
}
}catch(Exception cex){
log.error("Exception occured in reading currency "+ cex.toString());
}
}
return _supportedCurrencies;
}
Venkat