Criteria Object Creation. Getting Started
In this lesson we will apply a filter to the Product objects in the Xafari Northwind demo. Then we will learn, how to activate for this objects the feature to use filters criteria as default value.
- Set filters to the Product object as shown in the image below. Note, that you can also set filter in the CollectionSource.Criteria (in code) and in the GridView (in runtime). ListViewCriteriaObjectCreatingControllerWin process them all.
- Add module XafariModule to Module Project.
- Invoke the Model Editor. Navigate to Views|Xafari.Northwind.Classifiers|Product_ListView|Columns|Discontinued node. Set UseByListViewCriteriaObjectCreating property to true.
Note, that you also can set UseByListViewCriteriaObjectCreating property for corresponding OwnMembers item in the BOModel node.
The value of this property in the BOModel node is used as a default value in the Views node.
- Now you can run applications, and see the result. You can go to Product_DetailView (Main|Classifiers|Product navigation item) and click New button.
The Discounted property value set to true automaticaly, since the true value used as filtering criteria.