Use the following method for getting the selected value of a LOV Component.
private String getDrpDwnValue(String voIterator, String columnName, String rowIndex){
String drpDwnValue = "";
try {
DCBindingContainer bindingsOperand =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding voIterBinding =bindingsOperand.findIteratorBinding(voIterator);
Row voIterRow = null;
if((rowIndex==null)||(rowIndex.equals(""))){
voIterRow = voIterBinding.getCurrentRow();
}
else{
voIterRow = voIterBinding.getRowAtRangeIndex(Integer.parseInt(rowIndex));
}
drpDwnValue = (String)voIterRow.getAttribute(columnName);
} catch (Exception e) {
// TODO: Add catch code
e.printStackTrace();
}
return drpDwnValue;
}
Input parameter to this method are
voIterator-> iterator Name
columnName -> coloumn name for which you want the value
rowIndex -> it is the index when you get after getting the Attributevalue() of that LOV component
private String getDrpDwnValue(String voIterator, String columnName, String rowIndex){
String drpDwnValue = "";
try {
DCBindingContainer bindingsOperand =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding voIterBinding =bindingsOperand.findIteratorBinding(voIterator);
Row voIterRow = null;
if((rowIndex==null)||(rowIndex.equals(""))){
voIterRow = voIterBinding.getCurrentRow();
}
else{
voIterRow = voIterBinding.getRowAtRangeIndex(Integer.parseInt(rowIndex));
}
drpDwnValue = (String)voIterRow.getAttribute(columnName);
} catch (Exception e) {
// TODO: Add catch code
e.printStackTrace();
}
return drpDwnValue;
}
Input parameter to this method are
voIterator-> iterator Name
columnName -> coloumn name for which you want the value
rowIndex -> it is the index when you get after getting the Attributevalue() of that LOV component
Comments
Post a Comment