How to: Display a List of Non-Persistent Objects with an Intermediate Container Class and Its Detail View
This example stores a list of books. When a user clicks the Show Duplicate Books action, a popup dialog displays a list of duplicated books and their copy counts. This list is shown with a detail view.
Note: This example uses an intermediate container class to display a list non-persistent objects. In this case, the ObjectsGetting method cannot be applied. If your application logic does not require complex operations to create non-persistent objects, use the ObjectsGetting method. Refer to the following help topic for implementation details: How to: Display a Non-Persistent Object's List View from the Navigation.
- Declare the
Book
persistent class. Objects of this class denote books in a collection. - Declare two non-persistent classes—
Duplicate
to store unique book titles and the total number of books with these titles, andDuplicatesList
to aggregate theDuplicate
objects. - In a controller, implement a method that iterates through persistent
Book
objects, counts the number of copies of each book, and saves this information in a dictionary. - Implement a method that iterates through dictionary items and creates
Duplicate
objects for items with a value greater than one (books with more than one copy). AddDuplicate
objects to aDuplicatesList
collection. - Add the PopupWindowShowAction to display a popup dialog when a user clicks the Show Duplicate Books action. Handle the CustomizePopupWindowParams event and call the CreateDetailView method to create a Detail View for the
DuplicatesList
object.
See the following help topic for more detailed information: How to: Display a List of Non-Persistent Objects in a Popup Dialog
- Non-Persistent Objects
- How to: Display a List of Non-Persistent Objects with an Intermediate Container Class and Its Detail View
- XAF - How to Implement CRUD Operations for Non-Persistent Objects Stored Remotely
- XAF - How to edit non-persistent objects nested in a persistent object
- XAF - How to filter and sort non-persistent objects
- XAF - How to refresh non-persistent objects and reload nested persistent objects
- XAF - How to edit a collection of persistent objects linked to a non-persistent object
(you will be redirected to DevExpress.com to submit your response)