Hi!
My application tabs are dynamic, meaning that the tab index changes depending on the condition.
How can I get the tab index of a specific tab if the tab index is dynamic?
I've tried doing this
$parameters.TabIndex = document.getElementById($parameters.TabHeaderId).tabIndex;
But it does not return the tab index
Regards,
Andi
Actually, I have found another way.
I gave each tabitem header a specific class that only it has.
Then I used this Javascript:
$parameters.TabIndex = document.getElementsByClassName($parameters.TabCLass)[0].getAttribute("data-tab");
It returns a text. You just have to convert from text to integer
Hi @Andi,
can you elaborate on what exactly you are trying to do.
In what way is it dynamic ? based on a list or some other way ?
Where exactly do you need this tabindex. I just tried with a list, and there's 2 places you do something with a tabindex : the startingTab property of the tabindex widget, and the ActiveTab input into the OnTabChange event.
Which one of these do you have a problem with ?
Dorine
Hello
You can use handler On change tab It will return you the tab Id,
You can use it to and made change to your code
Here are some links that might help
Best Regards
Tousif
Hi Andi,
You can very easily find out this with JavaScript:
Basically, OutSystems UI tabs, will have the headers with elements identified with class osui-tabs__header_item (see below an example of three headers) and the active one will have the osui-tabs--is-active class.
The JavaScript snippet loops each of the headers and returns the (zero-based) position of the active one.
Kind Regards,João
You can use OnTabChange event. It will give you the active tab index number and you can store that value in local variable. Use that Local Variable value wherever you need.
I am just elaborating Dorine OnTabChange line.
Thanks and Regards,
Rahul Kr.