Sunday, September 1, 2013

What does an AM contain? / How to add rows in a transientVO

Application Module contains the getter methods for the various view objects that are being exposed in the AM. Using which we can get the instances of the of the View Objects. For a transientVO we can call this method and add the attributes for a row.

method in the AM to add rows to a transientVO:-

public void addRows(){
 //get the instance of the view object
 TransientVOImpl vo = getTransientVO();
//get the instance of the transient row by using the VOImpl object
 TransientVORowImpl row = (TransientVORowImpl )vo.createRow();
 // set the attributes of the transientVO by using the setter methods in the RowImpl class of the VO
 row.setEmpId(id);
 row.setEmpName(name);
 row.setEmpSalary(salary);
  // insert the row
  vo.insertRow(row);
}

No comments:

Post a Comment