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

9 comments:

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

    Sorry about this errata.

    ReplyDelete
  2. how to add count function in custom vo

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

      Delete
  3. prefer using second method createAndInitRow because it sets default values of attributes

    What do you mean this sentence ؟
    Did you mean that if I do not enter any value, the default value will be set.

    so, I did not find any difference between the two sentences.

    Thanks .

    ReplyDelete
    Replies
    1. "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

      Delete
  4. how to add count function in vo which count no of employee or total no of line if we want to count total shipment line please tell in detail?

    ReplyDelete
    Replies
    1. 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

      Delete
  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

How to Pass Parameters to ActionListener in ADF

In some cases, it is required to pass a value to ActionListener of ADF Button. The method that can be invoked by actionListeners has only...