Search This Blog

Populate Values From Data Controls using RowSetIterator and ViewObject


Populate Values From Data Controls  using RowSetIterator  and ViewObject


Using ADF BC ( Employees Table values populated  ) From HR schema


import oracle.adf.model.BindingContext;
import oracle.adf.model.binding.DCBindingContainer;
import oracle.adf.model.binding.DCIteratorBinding;
import oracle.jbo.Row;
import oracle.jbo.RowSetIterator;
import oracle.jbo.ViewObject;




public void getValues(ActionEvent actionEvent) {


DCBindingContainer dcBindings =(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dciter = dcBindings.findIteratorBinding("EmployeesView1Iterator");
ViewObject vo = dciter.getViewObject();
RowSetIterator RowSetI= vo.createRowSet(null);
RowSetI.reset();
while (RowSetI.hasNext()) {
Row row=RowSetI.next();
System.out.println("Employee Name ::::: " + row.getAttribute("FirstName"));
}
RowSetI.closeRowSetIterator();
}



OutPut :

Employee Name ::::: Sarath
Employee Name ::::: Clara
Employee Name ::::: Danielle
Employee Name ::::: Mattea
Employee Name ::::: David
Employee Name ::::: Sundar
Employee Name ::::: Amit
Employee Name ::::: Lisa
Employee Name ::::: Harrison
Employee Name ::::: Tayler
Employee Name ::::: William
Employee Name ::::: Elizabeth


No comments:

Post a Comment