It seems, my previous post about Create, Edit and Delete operations in ADF Faces af:table component is popular, I have received comments and questions from JDeveloper/ADF developers. One of the most interesting questions was about how to use the same functionality for Master-Detail, when both are based on af:table component. I have decided to implement Create/Edit/Delete functionality for Master-Detail case and to show how it works in Oracle ADF - EditableMasterDetailTable.zip.
Business logic is simple - relation between Countries and Locations entities from standard HR schema is implemented. Countries is for Master, and Locations for Detail. Master-Detail screen:
When row in Master table is selected, Detail table is updated automatically. It happens, because Oracle ADF provides Partial Page Rendering (PPR) functionality. Developed sample allows to manage Master record and at the same time dependent Detail records can be managed also.
Create functionality in Master table:
When record in Master table is saved, it becomes possible to add dependent records in Detail table: