01 March, 2012

Insert Rows in ADF View Object Programatically

I will illustrate how to insert new rows in view object programatically.

ٍSuppose that I have EmpVO view object which have below attributes
a-EmpId
b-FirstName
c-LastName

We can do inserting rows by two ways in data model layer (Application Model or ViewObject classes)
I will write my code in ApplicationModuleImpl class


1-createRow() method

2-createAndInitRow() method

 
I prefer using second method  createAndInitRow because it sets default values of attributes in view object but first method insertRow doesn't do this.

Mahmoud Ahmed El-Sayed

7 comments:

  1. The line
    ViewObjectImpl vo=this.EmpVO();
    should be
    ViewObjectImpl vo=this.getEmpVO();

    Sorry about this errata.

    ReplyDelete
  2. Read this post, it may guide you
    http://mahmoudoracle.blogspot.com/2011/07/summary-functions-in-adf-business.html

    ReplyDelete
  3. "Did you mean that if I do not enter any value, the default value will be set?"
    The answer is yes.

    "so, I did not find any difference between the two sentences."
    There is difference as first method doesn't set default values but second method set default values in view object if they haven't value

    ReplyDelete
  4. You have two view object (Master and Detail)
    suppose Master view Object is Dept, Detail view Object Emp
    You should add transient attribute to master view object(Dept) and in default expression of attribute write the below groovy code
    Emp.count("EmpNo")
    Note that EmpNo is an attribute in Detail view object(Dept)

    I think this link will guide you
    http://mahmoudoracle.blogspot.com/2011/07/summary-functions-in-adf-business.html

    ReplyDelete
  5. Hey, Mahmoud A. ElSayed
    In ADF:-
    Can I make Dynamic Database Connection with Oracle EBS at Run Time.If we have multiple Oracle Servers.So that I can Have a Desktop Form not Web ,From which I ask from user abot Server Information,Then Create connection and rest are same.

    ReplyDelete

ADF : Scope Variables

Oracle ADF uses many variables and each variable has a scope. There are five scopes in ADF (Application, Request, Session, View and PageFl...