Skip to content

DevExpress-Examples/xaf-how-to-display-a-list-of-non-persistent-objects

Repository files navigation

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.

Blazor application: Non-persistent objects in a dialog popup

Implementation Details

  1. Declare the Book persistent class. Objects of this class denote books in a collection.
  2. Declare two non-persistent classes—Duplicate to store unique book titles and the total number of books with these titles, and DuplicatesList to aggregate the Duplicate objects.
  3. 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.
  4. 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). Add Duplicate objects to a DuplicatesList collection.
  5. 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

Files to Review

Documentation

More Examples

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)