If there is any table component in the ADF UI , and you want to get the currently selected row in the Application module use the following code snippet
Let the VO name be StockDetailsVO
Steps
1. Get the VO instance
2. Get the currently selected row
3. Get the data from currently selected row
public void addStocksToPortfolio() {
// get the VO instance
StockDetailsVOVOImpl vo = getStockDetailsVO();
//Get the currently selected row, typecast it to VORowImpl Class type
StockDetailsVORowImpl currentRow = (StockDetailsVORowImpl)getStockDetailsVO().getCurrentRow();
//We get the data as below
int stockID = currentRow.getStockid();
String stockName = currentRow.getTimeadded();
}
Let the VO name be StockDetailsVO
Steps
1. Get the VO instance
2. Get the currently selected row
3. Get the data from currently selected row
public void addStocksToPortfolio() {
// get the VO instance
StockDetailsVOVOImpl vo = getStockDetailsVO();
//Get the currently selected row, typecast it to VORowImpl Class type
StockDetailsVORowImpl currentRow = (StockDetailsVORowImpl)getStockDetailsVO().getCurrentRow();
//We get the data as below
int stockID = currentRow.getStockid();
String stockName = currentRow.getTimeadded();
}