Go back but retain filter

Hi, this is probably simple but I can’t work it out…

I have a table which is filtered using a couple of select menus (form method=“post”).

Within the table are links to various detail pages. On the detail pages I want links to go back to the main table but obviously retain the previous filtered values so they don’t have to be selected again.

I am using URL parameters to carry the filter values to the detail pages. These values are then stored in hidden fields within another form which posts them back to the main page. However this is not working as expected - the main table just reloads with the first record.

I’m sure there must be a more logical way to do this but I’ve only just started learning Wappler (which I love so far) and some of the functionality can be tricky to find.

Thanks for any help.

Yes, there is a much easier way. Personally I use session variables.

On change of your form fields set session variables to the value of your input for each input you want remembered. Then on those inputs set a dynamic attribute —> value to the value of those session variables.

1 Like

An even easier way is to add a static event: javascript:history.back() to your back button. That will take you back to wherever you were, with the correct URL parameters etc. But there are situations where Brad’s solution will be more appropriate.

1 Like

All of the above + you can also use cookies to do this.

1 Like

I’ve tried that and the master table just reloads with the first record.

I’ll try the session variable solution.

Thanks, I’ll give that a go.

Sessions are definitely a great way to keep the filters when going from one page to another :slight_smile:

2 Likes

Got it working with sessions - thanks for your help.

1 Like