Reactive Web: Persistent Filter
Application Type

This question is based around what is best practice for filtering aggregates in Reactive web.

Scenario: I have a main screen and a filter with 10+ options, all basic data types (text/integer/identifiers). The filter choices need to be persistent for the user when navigating back to the main screen.

 In traditional web previously I have made a structure of the Filter, and then used that filter structure as a session variable. This allows the user to set filtering, then leave the page and when they return the same filters will be in place. 

How should I do this in Reactive. I could make Client variables for each of the filter fields, but that doesn't seem right. I also thought about saving the filter to an entity against a userid - but since all the data loads asynchronously, would that not create a challenge to use that to filter the data for the screen?



Rank: #1046

Hi Chris,

At the moment I'm using the solution of using client variables for each filter, and group them in a folder. But if someone has a better solution I'm interested too.

Rank: #262

What you could do is still use your filter structure, but to store it in a client variable, you JSONSerialize it into 1 text. So your client variable will have a JSON representation of your structure.

Whenever you need the filters again, you deserialize it back to the structure.

Rank: #171

Hi Chris,

In my opinion this is exactly a case that you should use a Client Variable.

Check this video about the usages of it.

One of the sample when using it, is a Search KeyWord that would be also a filter:

The only problem I see in this case is if the filters you are storing in Client Vars are in anyway sensitive informations.

If not, I think the right way to do what you want is indeed using the Client Vars.

Cheers and Regards,

RR :)