Changing List filter with the change of tabs
Question
Application Type
Mobile
Service Studio Version
11.11.2 (Build 43110)

Hi, I am trying to change the filter on a list as I change to a different tab. 

My list contains a lot of questions, and there are different types of questions.

For example, the question types are "Mandatory", "Not Mandatory", etc.

I realized that it is easier to filter the questions by the question types on different tabs, so one tab contains all "Mandatory" questions, while another tab contains all "Not Mandatory" questions. I also have a tab containing "All" questions. 

Is there a way I can change the filter while changing tabs, such that they are all getting their data from the same fetched database? 

Cheers!

Solution

Another solution, but now changing the CSS from the link on tabs, reflecting the problem that I said in the first answer.

what I will need to do, is remove the padding and put the height to the links on the tabs header. why? Because when I click on the link, even if it's not on top of the link but on the are of the header tab, the aggregate will be filtered anyway.

Kind Regards,

Márcio

Ps: I did the solution on reactive, but you can use this solution on mobile.

https://marcio-carvalho4.outsystemscloud.com/OutSystems/filtertabs?_ts=637593509720920511

tabsfilter.oml

First, I would choose a button group to do that.

But I think yes, you need to have a local variable to be assigned with the filter text. Then on the tabs header have a link that goes to screen action, assigns the filter you want to do, and then refreshes your aggregate.

I will try

Regards,

Márcio

I could come up with a solution, but you need to click exactly on the link, and then it is filtered, you cannot enclose a tab header in a link. One solution for that is!! Remove the padding from the tabs header and put an height on the link attribute(CSS), and then the height will tell you the zone where the user can click :)
I will update the solution for that in another answer if you want

Kind Regards,

Márcio

tabsfilter.oml

Solution

Another solution, but now changing the CSS from the link on tabs, reflecting the problem that I said in the first answer.

what I will need to do, is remove the padding and put the height to the links on the tabs header. why? Because when I click on the link, even if it's not on top of the link but on the are of the header tab, the aggregate will be filtered anyway.

Kind Regards,

Márcio

Ps: I did the solution on reactive, but you can use this solution on mobile.

https://marcio-carvalho4.outsystemscloud.com/OutSystems/filtertabs?_ts=637593509720920511

tabsfilter.oml

Hi Marcio, thank you so much for the help! 

I just want to check, is there a way to filter the list without refreshing the data? This is because I realized that as I changed tabs, the answers that had been filled out prior would be erased. 

What I do to save the answers is to add them to the fetched data as an "Answers" attribute. However every time I change tabs, it will reset the whole thing due to the data refresh. 

Is there a way to filter without refreshing the data, or is there a different way for me to keep track of the answers that the user has input? Hope my question can be understood.

Cheers!

Hello Lucas, thanks!

Yes and No, you have to refresh because if you don't you will not get the data based on the filters, it will filter, but it will not bring the new data based on the filters!

One thing you can do to keep the answers, is, saving the answers on a local variable of type list of answers, and every time you filtered the aggregate again you would updating the local variable with answers, and showing and not showing, based on the filters and the id of the questions that have answers.

In this way even refreshing the aggregate, you would keep the answers because is not an aggregate but is a local variable and is not affected. And also... when you got at the point of refreshing again, you would compare what was on the aggregate and if there was a match with the answers on the local variable because on that variable, you can use a structure, or event an entity structure, and that structure has the answer and the id to the question to be compared to know to which question the answer is assigned.

Any doubt, ask me pls


Kind regards,

Márcio

Hey Marcio, 

I have been trying to save answers on the local variable of type list of answers as you said but I don't seem to be able to make it work. Do you have any tips for doing this?


Cheers!

Lucas

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.