Forum Academy Marketplace Showcase Pricing Features

How to keep the same Tab when a page is refreshed

I have a page with tabs (built with the standard tab element template).

When the user refresh the page, no matter which tab he was in, the tab element reset itself to a x default state.

how can I keep the same tab?

thanks!

sorry i dont know :cry:

when i updated this page, should be a refresh.

Yes I know it’s a pain… I tried also with go to page and send parameter "“parameter” that is taken by a input, transformed in number, and then I had this workflow to set the state of the tabs:

It solved the problem of keeping the same page after refresh (because the state is in the url), but it was working quite bad in general… requiring to click more times before the tabs show off…

So i came back to previous configuration… but I’m stucked with the same problem…

You can store the last shown tab on the user or a preferences data type.

Maybe yes Scott but this would consume 1 workflow every tab change…

All of the solutions that I can come up with for this require you to store data in the database when a user clicks a new tab, so all of them require a workflow. That’s just the cost of this functionality.

1 Like

I think I got it! I found a way to skip the text/number conversion of the parameter in the input:

when i pull the parameter, I don’t pull his value but his “number of characters” this way it is already number. (es: a=1, ab=2, abc=3, abcd=4…)

and it works fine with tabs because there is no input output step interfering with the process.

Nice workaround hack … but it does make the app harder to understand.

I guess that you are only using the numbers to distinguish one tab from another, and not doing calculations on them, so you could use text values instead, like “tab1”, “tab2” or something more meaningful like “tabfile”, “tabmenu”.

Yes I use it only for tab switching.

I think I will call the state “a” to make it shorter, and the values will be 1=1, 12=2, 123=3, 1234=4… so it will be easy to read as the last number will be the same number as a standard state tab number if you know what I mean…

It’s worth knowing that the tab number doesn’t have to be standard … for example:

Can become:

And

Can become: