Requirment – Creating new rows through the view object
Solution-Create a new view row by calling createRow() on the view object as shown in the following code snippet:
/**The createEmployee is a custom method defined in application
* module implementation class.
*/
public void createEmployee () {
//Get the view object
ViewObject employee= findViewObject("EmployeeVO");
// Create a row and fill in the columns.
Row row = employee.createRow();
row.setAttribute("Name", "Vinay");
row.setAttribute("EmpId", 1);
//Insert row in to the default row set
employee.insertRow(row);
}
You can also use createAndInitRow(AttributeList initVals) on the view object to create a new view row. This API allows you to initialize the row with an attribute list.



