Hello,
Found this bug related with the Tabs widget:
I cannot use an IF statement to hide the tabs header and content, since the active tab only follows how many tabs were rendered.So if I put an IF statement with user permissions to show only the ones the user has available, the might get a chance that he clicks one tab and sees the content of another one (local variable ActiveTab and the one the front end don't match).The new addition in version 2.12.0, the ActiveTabAsIndex doesn't solve this problem (with this flag as false, the behaviour is resetting the tab to 0 and showing content of the one clicked, and the Active tab is the one he counted as shown).The solution I found is to use the extended class to insert a custom class with the "display: none;" attribute. And to top it off, it is required to hide both text of the header and content in order for the user to not user the inspect element and disable this attribute.It's is quite the workaround to ensure that both header and content is unnaccessible for the user, when encapsulating both header and content in an IF statement should be enough.I share the OML to help see the problem when using the IF statement in Tabs, and also to review if the solution I provided is the most accessible one for this case.
Good day,Ionut Vrinceanu
Hi @Ionut Vrinceanu,
Well, the logic of tabs is expecting on having strings at DataTab since by the logic done at that time, the index is being used to do some other validations, which ends badly when a string that can be parsed into an integer is in use. :(
First, you should use for example "tab-one" at DataTab attributes.
Secondly, since at the OnTabChange event we're passing an integer you need to get the correct DataTab value according the selected Tab.
So, every time you need to update Tabs Visibility, you need to check what is the tab you should set as Active accordingly.
Attached you can find an oml with this implemented.
Hope it helps,
PS: Do not forget to close this post if you consider it answered.
Cheers,JR
The solution presented works yet it is sluggish to implement and lacks the scalability if I want to change the tabs positions or add new ones. In cases where tabs that have almost ten tab-items, all with permissions, is quite the challenge to have to manage which one is the next tab, since it might not be the very next one.I can make do with the solution presented and try to use a "tab-"+ (currenttab +1) to reduce some of the IF clauses, but it would really help if the datatab could be passed on the action instead of the tab index. I wonder if that is possible in the near future.Cheers,Ionut Vrinceanu
Hi @Ionut Vrinceanu! Thank you for your feedback, it's on our radar now. Currently, our focus in terms of new features is on reactive apps. Unfortunately, as a result, improvements related to use cases that can be achieved through workarounds have lower priority. If the priority changes we will let you know. Cheers,Jéssica Mendes