[Oracle ADF] Iterator

1
2
String myIteratorName = "myIteratorName";
String myAttributeName = "myAttributeName";


1
ADFUtils.findIterator(myIteratorName).executeQuery();


1
ViewObject vo = ADFUtils.findIterator(myIteratorName).getViewObject();


1
Object myValue = ADFUtils.findIterator(myIteratorName).getCurrentRow().getAttribute(myAttributeName);


Еще 1 вариант получить текущую строку (если нужно будет, например пройтись по VO для каких-нибудь целей)

1
2
3
4
5
6
MyVOViewImpl myVo =
        (MyVOViewImpl) ADFUtils.findIterator("OrderSheduleDeliveriesView1Iterator").getViewObject();

 MyVOViewRowImpl currRow = myVo.getCurrentRow();

RowSetIterator rs = myVo.createRowSetIterator(null);


В MyVOViewImpl к VO добавляем:


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


Утановить программно итератор по ключу:

1
2
DCIteratorBinding myBindings = ADFUtils.findIterator("OrderSheduleDeliveriesView1Iterator");
myBindings.setCurrentRowWithKeyValue("4444");


https://docs.oracle.com/middleware/1213/adf/api-reference-model/oracle/adf/model/binding/DCIteratorBinding.html


Создать SOC с локалями:

1
2
3
4
5
6
<af:selectOneChoice value="#{bindings.Language.inputValue}"
                   label="#{usersBundle['users.user.language']}"
                   id="soc3"
                   required="true">
   <f:selectItems value="#{pageFlowScope.MyBean.supportedLocales}" id="si6"/>
</af:selectOneChoice>


1
2
3
4
5
6
7
8
9
10
11
12
13
14
public List<SelectItem> getSupportedLocales() {
    Iterator<Locale> iteratorSupportedLocales = FacesContext.getCurrentInstance()
                                                            .getApplication()
                                                            .getSupportedLocales();
    supportedLocales = new ArrayList<SelectItem>();
    SelectItem itemLocale = null;
    while (iteratorSupportedLocales.hasNext()) {
        Locale locale = iteratorSupportedLocales.next();
        itemLocale = new SelectItem(locale.getLanguage(), locale.getDisplayName(), locale.getDisplayName());
        supportedLocales.add(itemLocale);
    }

    return supportedLocales;
}