This post is about adding a row at the end of current rowset of viewObject without using table or any other UI components binding Here I have a Department ViewObject (HR Schema), dropped as a table on page and a button to add new row, this button calls a method from model using binding layer
Here I am showing how to insert new row in ADF view object programmatically.
For this create a method in managed bean for your button on that you want to insert row.
and call this AMImpl method that makes use of ViewObjectImpl createRow method to add new row in RowSet
Created a method in AMImpl class and it'll be called in managed bean using binding layer
This method creates a row in ViewObject , and you can set(Insert) this row with some values using this simple snippet of code
//Get ViewObject Instance
ViewObjectImpl demoVo =this.getEmployeesDemo1();// Creates a row in ViewObject
Row r = demoVo.createRow();// You can set attribute values in this new row
r.setAttribute("EmployeeId",001);//Insert that row in ViewObject
demoVo.insertRow(r);//Commit the changes, If you needthis.getDBTransaction().commit();
demoVo.executeQuery();