Iterating a table rows while it's filtered

I 'm trying to iterate through the rows in a table that has been filtered in a Fusion Application in ADF. This table was created from a DataControl. Normally I iterate through the view object associated with the table but if the request is made while the table is still filtered the view object only iterates through the filtered rows. This is the code that I have so far

public void SelectingAll() {

    DCBindingContainer dcb = (DCBindingContainer) evaluateEL("#{bindings}");
    DCIteratorBinding dciter =dcb.findIteratorBinding("DimEntidadView1Iterator");        
    ViewObject vo = dciter.getViewObject();

    Row row = vo.first();
    vo.reset();        

    while (row != null) {

        row.setAttribute("SelectEnt","true");
        row = vo.next();
    }

}

The problem is that if the method is executed while the table is still filtered the ViewObject only iterates for the filtered rows.

Upvotes: 0

Views: 2162

Answers (1)

Rafael Guillen
Rafael Guillen

Reputation: 1673

I think iterators are made exactly for this job, you don't need to access the ViewObject, think for a moment, what if the table is not based in a ViewObject? You can do something like this without refering you backend implementation:

    public void SelectingAll() {
        DCBindingContainer dcb = (DCBindingContainer) evaluateEL("#{bindings}");
        DCIteratorBinding dciter =dcb.findIteratorBinding("DimEntidadView1Iterator"); 

        RowSetIterator rsi = dciter.getRowSetIterator();
        while (rsi.hasNext()) {
            Row r = rsi.next();
            .
            .
            .
        }
    }

Upvotes: 1

Related Questions