Tuesday, March 26, 2013

Get the currently selected row in Application Module (AM) in ADF

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();
}

1 comment:

  1. Hi,

    Is this same can be applied for mmultiple selected rows, getting all the selected rows in the AM.

    Help me with the implementaion steps :)

    ReplyDelete