This content has been marked as final. Show 6 replies
build a View Object based on two entity objects (departments and employees) and then expose the department name and the employees details. Use this View Object to create the table. You then create a new row for this View Object (ensure the Departments entity is only referenced so that this is not getting updated with the new row (though you need to find a way to tell the employee which departments he/she belongs to)
I'm not sure you understand me correct. It's not a simple master-detail relation in editable table. Note, that employee names for each department are placed horizontaly. I think, the dynamic table is needed here. Except this - table should be editable and "Add" buton shoud create new column (not row).
There's no way that I know of to do this with the af:table component, at least not easily - you'd have to either write your own model implementation to back the table and pivot the data back to the structure needed by the "real" model or write your own table component that pivots for you. I haven't had opportunity to play around with the ADF Pivot Table to know if it can do what you like - that may be something for you to investigate.
I'm not sure is Pivot Table is correct way. I thik that adf editable table with "foreach coumn" inside is required. It obviously requires view object (in this case DeptView) with dynamic attributes (based on detail rows - Emp) maped to entity. I have no idea how to do it. Other problem - how to implement "Add" button that inserts new column with input texts for each row?