Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Reset iterator binding

Sydney H.Jan 22 2014 — edited Jan 23 2014

Hi,

I display a table based on an iterator binding executable. I click on a row, then on a button outside the table that positions the iterator at the end, add a new row and navigate to a new fragment:

    private void createRow(String iteratorName) {

        DCIteratorBinding binding = ADFUtils.findIterator(iteratorName);

        //access the underlying RowSetIterator

        RowSetIterator rsi = binding.getRowSetIterator();

        //get handle to the last row

        Row lastRow = rsi.last();

        //obtain the index of the last row

        int lastRowIndex = rsi.getRangeIndexOf(lastRow);

        //create a new row

        Row newRow = rsi.createRow();

        //initialize the row

        newRow.setNewRowState(Row.STATUS_INITIALIZED);

        //add row to last index + 1 so it becomes last in the range set

        rsi.insertRowAtRangeIndex(lastRowIndex + 1, newRow);

        //make row the current row so it is displayed correctly

        rsi.setCurrentRow(newRow);

    }

On that fragment I have a Cancel link that removes the added row, and set the current row to null, so no row is selected.


    private void cancelCreateRow(String iteratorName) {

        DCIteratorBinding binding = ADFUtils.findIterator(iteratorName);

        RowSetIterator rsi = binding.getRowSetIterator();

        Row currentRow = rsi.getCurrentRow();

        if (currentRow.getAttribute("Id") == null) {

            rsi.removeCurrentRow();

        }

        rsi.setCurrentRow(null);    

    }


The issue is that the last row is still selected. What am I doing wrong?

This post has been answered by Frank Nimphius-Oracle on Jan 23 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2014
Added on Jan 22 2014
1 comment
411 views