How to create Static Columns and use in UI - ADF 10.1.3.3
Consider Employee View Object of HR Schema having predefined columns in it as shown below, create a transiant column "SalaryRange" that act as virtual column to hold static SalaryRange values in it.
Model View Object :
Page Def Changes :
Create method in Application module and add below code in it.
public void salaryRange () {
ViewObject vo = findViewObject("EmployeesView");
RowSetIterator iter = vo.createRowSetIterator(null);
while (iter.hasNext()) {
Row row = iter.next();
String status="";
if( Integer.parseInt(row.getAttribute("Salary").toString()) > 5000)
status = "High";
else
status = "low";
row.setAttribute("SalaryRange", new String(status));
}
iter.closeRowSetIterator();
getDBTransaction().commit();
}
User Interface with salaryRange column values :