Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

ADF table: How to find out which rows were modified

cmsyamkJan 11 2024 — edited Jan 11 2024

Hi,

I am using jdeveloper 12.2.1.4.0.

Use case:

Placed an editable table in the jsff page. When the user click on save button the user should get the rows which has the value change.

I have done this in the voimpl. There i am getting the rowkeys. But if the user changes a value and before save he replaced the new value to the old value still its showing the row is modified.

for example:

Name is ABC when page is loading

user changing it to ABCDE

Before save he changed it back to ABC and save. Still its showing the row is modified but in front end there is no change in the value.

Here is the code which i use:

public void processChangedRows() {
Iterator iter = this.getEntityDef(0).getAllEntityInstancesIterator(this.getDBTransaction());

while (iter.hasNext()) {
EntityImpl eo = (EntityImpl) iter.next();

if (!"default".equals(this.getRowStatus(eo.getEntityState()))) {
System.out.println("KEY: " + eo.getKey() + " , STATUS: " + this.getRowStatus(eo.getEntityState()));
}
}
}

private String getRowStatus(byte statusFlag) {
if (statusFlag == EntityImpl.STATUS_INITIALIZED || statusFlag == EntityImpl.STATUS_NEW) {
return "new";
} else if (statusFlag == EntityImpl.STATUS_DELETED) {
return "deleted";
} else if (statusFlag == EntityImpl.STATUS_MODIFIED) {
return "modified";
}
return "default";
}

This post has been answered by Timo Hahn on Jan 11 2024
Jump to Answer
Comments
Post Details
Added on Jan 11 2024
2 comments
144 views