Persist User Defined Filters using MDK 6.1
With the release of MDK 6.1, we introduce support for programmatic filters in Object Tables. In this blog post, we will look at how this feature can be used to add persistent filters into your MDK application. With persistent filters, any filter that a user sets for the Object Table list page is stored so that the next time the page is opened, their previous filter choices are automatically applied.
You can read all about the new MDK 6.1 features in the What’s new in Mobile development kit client 6.1 blog post.
To aid you with implementing persistent filters, we have now added a new MDK Showcase app: Persistent Filters App, which demonstrates the feature.
With this showcase app, you will learn how to implement to the following functionality:
- Save the current filter to App Settings – App Settings is used instead of Client Data so that the filter value will be retained even if the application is closed and relaunched.
- Use the new Section Table filter property to define the default filter for the Object Table
- Load the current filter from App Settings and convert to a Filter Criteria Array
The showcase app works across all three MDK platforms (iOS, Android and Web). There are short demos of all three platforms on the app page in the Samples repo.
We will be creating more blog posts like this to introduce other showcase apps to help you learn to make the best use of MDK in developing your apps.
Feel free to add your thoughts and feedback in the comments section. If you have any questions about MDK in general, please visit the Q&A section in the mobile development kit SAP Community and post your questions.
All the apps in the SAP Mobile Development Kit Samples repository are made available under the SAP Sample Code license, which essentially means they are provided as-is, no warranties. Feel free to grab a copy and reuse the portions of the app that seem useful to you.