Hello,

I am using OutsystemsWebUI and I have a page with 3 tabs: 'Tab1', 'Tab2', and 'Tab3'.  I am using different aggregates on each tab with Ajax Submits etc.

How or where do I obtain the value of the new tab when changing tabs from say 'Tab1' to 'Tab3' i.e. I need to capture the value 'Tab3' ?

Cheers, Richard

Hello Richard!

You can create a screen action for "OnTabChange" event of the Navigation\Tabs web block:


Then on the "TabsOnTabChange" action you can already use value from the CurrentTab input variable, i have assigned it to a new variable in the screenshot below.

Note that this would return the tab index instead of the name, you can use a switch statement to get the name using a predefined list.


Hello Ian,

Thank you for the reply.  Why does 'CurrentTab' use the Tab Id when both the Tab Widget and the 'ActiveTab' use the Tab Name ?? And can I assign the Tab Ids or are they automatically assigned ?  If the latter, how do I determine the Id for each Tab so that I can assign the relevant name.  Lastly, is it possible to obtain the 'ActiveTab' name ?

Cheers, Richard.

Solution

Richard Pearce wrote:

Hello Ian,

Thank you for the reply.  Why does 'CurrentTab' use the Tab Id when both the Tab Widget and the 'ActiveTab' use the Tab Name ?? And can I assign the Tab Ids or are they automatically assigned ?  If the latter, how do I determine the Id for each Tab so that I can assign the relevant name.  Lastly, is it possible to obtain the 'ActiveTab' name ?

Cheers, Richard.

Hello Richard,


CurrentTab is the unique identifier of that particular tab.

The Tab Name is used to bind  the Tab Widget and the 'ActiveTab', as for assigning that ID's i thinks OS is automatically them.

As for determining the Tab Id's i would suggest that you try to output them using a feedback message and making a note of the IDs.

You can then use a switch statement to assign the tab name based on the tab ID.

Hope this makes sense.

Lastly, i am not sure if is it possible to obtain the 'ActiveTab' name.


Solution

Thanks Ian.

Using a feedback message is exactly what I had done to obtain the Tab Id.  It is not a good pattern where the Tab Name used as the identifier in some parts of the widget, and the Tab Id in another when there is no direct link between the two.

For now I will use an assign statement in the TabOnTabChange action to pair the Tab Ids with the Tab Names, and I have raised a new idea that the 'CurrentTab' be set to the Tab Name instead of the Tab Id.

Cheers, Richard. 

Richard Pearce wrote:

Thanks Ian.

Using a feedback message is exactly what I had done to obtain the Tab Id.  It is not a good pattern where the Tab Name used as the identifier in some parts of the widget, and the Tab Id in another when there is no direct link between the two.

For now I will use an assign statement in the TabOnTabChange action to pair the Tab Ids with the Tab Names, and I have raised a new idea that the 'CurrentTab' be set to the Tab Name instead of the Tab Id.

Cheers, Richard. 

Hello Richard,

please mark my answer as the solution

Thanks!


Ian Pornela wrote:

Hello Richard!

You can create a screen action for "OnTabChange" event of the Navigation\Tabs web block:


Then on the "TabsOnTabChange" action you can already use value from the CurrentTab input variable, i have assigned it to a new variable in the screenshot below.

Note that this would return the tab index instead of the name, you can use a switch statement to get the name using a predefined list.



Hello,

I'm trying to use the Navigation\Tab as you are directing but i do not see the same options in the Properties window as you are.  I only get the ActiveTab and LoadOnClick options.  Im currently running on the latest version 11.5.39 Build 605.