Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

confused about a new row's status

kcjimDec 17 2007 — edited Dec 28 2007
using jsf/adf bc. From the adf developer's guide:

When you use the Create or CreateInsert operations to declaratively create a new
row, under the covers they end up performing the following lines of code:
// create a new row for the view object
Row newRow = yourViewObject.createRow();
// mark the row as being "initialized", but not yet new
newRow.setNewRowState(Row.STATUS_INITIALIZED);
In addition, if you are using the CreateInsert operation, it performs the additional
line of code to insert the row into the row set:
// insert the new row into the view object's default rowset
yourViewObject.insertRow(newRow);

The guide goes on to explain that the status of this new row will be INITIALIZED, and not part of the transaction list. From what I can tell, the status of my new row is NEW, or 0. Here's what i've done:

I've dragged the Create method and dropped as a command button on the jsp. This view object is built on just one entity object, not multiples. I then went and changed it to a Create/Insert. According to the literature, when I click this button, a new row should be created, with its status being initialized, or -1. I've added another button to this page in which i'm checking the status of this newly created row. This was done by creating a custom view row class for the view object, and essentially calling both getPostState() and getEntityState() of the new entity row.
Here's the code, which is in the app module class and was added to the client interface in order to be dropped as a button and executed on the same page as the create button.

public void testRowStatus(){
PhoneViewImpl phoneDetailVO = this.getPhoneNumber();
PhoneViewRowImpl firstRow = (PhoneViewRowImpl) phoneDetailVO.first();
PhoneImpl phoneEntity = (PhoneImpl)firstRow.getEntity(0);


System.out.println("phone entity row state is: " + phoneEntity.getEntityState());
System.out.println("phone post row state is: " + phoneEntity.getPostState());

To summarize, after i click the button to create the new row using the declarative Create/Insert, I click the Check Status button to execute the code which will check the status of that new row. I keep seeing a status of NEW, or 0. I was under the impression that this new row would have an INITIALIZED status??
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 25 2008
Added on Dec 17 2007
8 comments
1,747 views