Sunday, December 4, 2011

Remove all rows from viewobject.

Define a method in Application Module Impl class.
Using below sample code you can delete all the rows in current resultset of view object
In Application Impl all the methods will have viewobject accessors(get and set viewobjects)

ViewObjectImpl employeesVO= getEmployees();
// 1. reset iterator to start before first row
shoppingCartVO.setRangeSize(-1);
Row[] rows = employeesVO.getAllRowsInRange();
// 2. iterate over rows and remove each instance
for(Row row: rows){
row.remove();
}
getDBTransaction().commit();