However, it is possible that in the view page you will be using a table, which will be based on a composite view object (based on several entities). And, editable form in the edit page will be based on another, simple non-composite view object. So, you may have a question - what about #{row.rowKeyStr} passed from view to edit page, it will be correct or no? In fact, it depends, how you have created a composite view object.
Developed sample - CompositeViewObject.zip, demonstrates how to synchronize a table which is based on composite view object with an edit form which is based on another non-composite view object. This sample is developed using ADF BC and is based on standard HR schema COUNTRIES and LOCATIONS tables. When I was developing this sample, my steps were:
- Create entity objects for COUNTRIES and LOCATIONS tables
- Create two view objects. One for Locations entity, and another (composite) for Locations and Countries entities. In the composite view object's entities list, first element is for Locations entity and second is for Countries entity
- Generate application module
- Create faces-config.xml and two pages - viewComposite.jspx and editLocations.jspx along with the relationship between them
- Create a table in viewComposite.jspx, based on composite view object
- Create an edit form in editLocations.jspx, based on simple view object
- Synchronize both pages
What's the problem? Why this error is generated? When reviewing created composite view object, I have found that for the second element (Countries) in the composite view object's entities list, 'Key Attribute' is checked:
This means, that #{row.rowKeyStr} for the selected row will be generated not only based on Locations entity 'Key Attribute', but also on Countries 'Key Attribute'. I have deselected 'Key Attribute' for CountryId1, that belongs to Countries entity and there is no more JBO-25006 error:
0 comments:
Post a Comment