[Oracle ADF] > Нужно пройтись по таблице программно

И в цикле проставить что-то полезное


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public String allAprove() {
    RowKeySet rksSelectedRows = this.t1.getSelectedRowKeys();
    Key key = (Key) ((List) rksSelectedRows.iterator().next()).get(0);

    MyVoViewImpl myVo =
            (MyVoViewImpl) ADFUtils.findIterator("MyIterator").getViewObject();

    RowSetIterator rs = myVo.createRowSetIterator(null);

    MyVoViewRowImpl currRow = myVo.getCurrentRow();

    rs.reset();

    String valAppr = currRow.getApproved();

    oracle.jbo.domain.Date myDate = currRow.getNotBeforeDate();

    while (rs.hasNext()) {
        MyVoViewRowImpl row = (MyVoViewRowImpl) rs.next();

        if (currRow.getQtyOrdered().compareTo(BigDecimal.ZERO) > 0){
            row.setApproved(valAppr);
        }

        row.setNotBeforeDate(myDate);
    }

    AdfFacesContext.getCurrentInstance().addPartialTarget(t1);
    return null;
}


В Имплементации добавлен метод


1
2
3
4
@Override
public MyVoViewRowImpl getCurrentRow() {
    return (MyVoViewRowImpl) super.getCurrentRow();
}