Search code examples
javaoracle-adf

how to select the currentRow again after iterator.excuteQuery() in adf?


i have ADF page that has update method , and after the update the table is refreshed , all of this business is done in the backing bean and here is the code

OperationBinding operationBinding =  ADFUtil.getBindingContainer().getOperationBinding("manageRequestStatus"); // this is the update method

Object result = operationBinding.execute(); 

after the update is executed the value is changed in the DB so i call this in order to refresh the adf table

DCIteratorBinding searchIterator = ADFUtil.findIterator("myIterator");
searchIterator.executeQuery(); 

this method to refresh the dataTable and the table is refreshed with the new data

the problem is : after executeQuery the first Row of the table is selected

what i want to do is : after refresh , select the same row

and this is my try :

RowSetIterator rsi = searchIterator.getRowSetIterator();
 Row currentRow = rsi.getCurrentRow();
 Key k =currentRow.getKey();
searchIterator.executeQuery();
rsi.setCurrentRow(currentRow) ;

Solution

  • i've solved this problem by following

    Int index =searchIterator.getCurrentRowIndexInRange();
    searchIterator.executeQuery();
    searchIterator.setCurrentRowIndexInRange(index);