Some times we need to identify modified or new rows programmatically and determine row status, to be more clear for users.
I have developed this sample application –FilterModifiedRows.zip.
in ADF (18.104.22.168.0).
Initially we need to customize default selection in table to get selected row key and add it in java Map if it is not already existed.
Note that keys stored in Map with null values:
And also customize default creation action to create new row and get selected row key and add it in SelectedRows Map if it is not already existed:
Then, We need to check status for each row in view object to identify whether status is New or Modified. by invoking checkRows method which iterate over selectedRows Map elements and update elements values and increment counters:
We have to customize Commit, Rollback actions to commit or rollback changes and reset selectedRows Map and counters:
Remember to remove SelectedRowKeys property from table.
Finally we can write following expression in inline style of column of table, so that it can check all rows in table and differentiate between different status:
You can see rows are highlighted by orange color after modifying, and highlighted by blue color after create new row. This informs user that he did changes in the table.