on 11-01-2023 9:36 AM
Hello Experts,
As part of our new project we have to develop an SAP MDK application.
On the main page, we have a button to navigate to the filter page that contains some ListPicker controls from which we get the values of filter criteria.
When we select values from those lists and click on filter button, we will navigate to the next page which contains an Object Table that we add a rule in QueryOptions in this table object that retrieves the selected values from the previous page.
This method works well, but it uses a static code to build the request to the backend.
Could you please provide me a solution to use the filter action or some dynamic approach to use it instead of the static method?
Thank you in advance.
Best regards.
Maroua ABBOUR
The filter action is typically included from a button in the action bar or toolbar to open a filter page from the list (Object Table) page. On the filter page the user can select criteria and when done it will apply that filter to the list page. You can see an example of it in the MDK Demo Application on the sample repo. If you tap the All Products link under the Promotion Items in the upper right is a Filter button that calls the filter action to let the user select criteria and apply it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your response bill.froelich, in our scenario, we have a "Form cell page" which contains five "List Picker" controls and a "filter" button.
After pressing under this button, we will navigate to the list page that contains an 'object table'.
In the "QueryOptions" of this table, I created a rule in which I built a static request to the back-end based on the selected values from the previous page.
I have attached a part of my code to clarify the idea.
Is there another method to apply the $filter request to the back-end in the online service dynamically?
Thank you again.
I would recommend looking at the example of it in the MDK Demo Application on the sample repo. If you tap the All Products link under the Promotion Items in the upper right is a Filter button that calls the filter action to let the user select criteria and apply it. This is an example of how a user can adjust the filters for a list on the fly.
It all depends on what you want the flow to be. One option would be to just open the list page without any initial filters and display all the data, You can still apply query options to define the initial list. Then the user can open the filter page to see the list pickers to choose filter criteria and apply to to the existing list page.
If you want your flow to prompt the user to initially define the filters before opening the page as you described, then you will need a rule to create those as filter criteria instead of as query options and bind the rule to the Sectioned Table > Filters on the list page.
I would first thank you for your help and the quick reply bill.froelich.
I have tried to implement the solution that you suggest to me (By making the filter as a rule in Sectioned Table > Filters instead of in query options), but i still have an issue, the backend method is called twice ( the first time without any filter and the second with the selected values ).
Is there a way to implement to skip the first call?
Thank you again.
User | Count |
---|---|
65 | |
8 | |
7 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.