Friday, September 21, 2012

ADF Create and CreateInsert Operations for ADF Table

I bet every ADF developer was wondering in his life at least once - what operation to use to insert new row into ADF table - Create or CreateInsert. This one is a must question from developer who starts ADF development. Answer - use CreateInsert operation to insert new rows into ADF table or form. Create operation works with form component only. However, this is not so obvious - I saw such situations when developers where stuck for some time, because they were unable to implement new row insertion (just because of using Create, instead of CreateInsert). It looks like CreateInsert operation calls additional functionality to push newly created record and really display it in ADF table just after operation is completed. But Create operation is missing that part. I will describe in this post with example.

Download test case application - Test case contains simple page, both operations Create and CreateInsert are implemented directly from Data Control:

There is only one page, where I have both ADF form and table. Same Create and CreateInsert operations are applied for both blocks:

Operations are defined in Page Definition file:

Firstly we test Create operation - press Create button for the table:

There is no new row rendered in the table, but new row was inserted only into form component - this is a problem most of new ADF developers are facing. User gets confused - press second time on Create and ADF will show validation errors for missing required fields in the form:

CreateInsert operation behaves much better - press CreateInsert button and you will see new blank row inserted into ADF table. User is ready to type data and commit it. Also new row was inserted into form component - this means CreateInsert works for form and table:


MinBzid said...

Hello Andre!
i built a tree which has many levels!! so i need to insert values for a specific level so i wonder if i can achieve this with -> create!i need to create a new row and in the same time to keep the Parent_id "the level" i am at..

Best Regards

Francesco Savino said...

Hello Andrejus , but what is the real kind of row that ViewObject retain when I use the Create operation ? it is a row with a corresponding entity but just non commited , is a row just inside the ViewObject's iterator or is just a row retained by ADF form ?
And How I can retrive this row just created if don't have holder variables at pageDef (this is the point ! I rely on some place where row is maintained ..)


Anonymous said...

I cannot download the test case application.
I am getting Error 404
The requested URL /files/ was not found on this server

Andrej Baranovskij said...


All old samples can be downloaded from Google Archive -


Anonymous said...

Thanks for your response
Do you have similar test case in
It's trying to convert JSF 1.0 to 1.2


Anonymous said...


Can help to share me the fusionFx skin file attached with the test case?

Andrej Baranovskij said...

It is packaged with ADF.


Alex said...

Hi Andrejus!

We are using the open-blank-form pattern: create a new blank row (with createRow, not with createInsertRow) in viewObject when form is opened and bind it to the form via IterBinding.
The problem we are facing is that this new row becomes a stray row if the user decides to simply navigate to another page, bypassing the cancel button (this button explicitly removes the row).
When the transaction is commited by some other business functionality, this stray row gets inserted into the DB.
Is there a way to prevent the insertion of this stray row?