.isTabEnabled() issue

I have this issue:

I want to show and hide tabs from a tabpanel by a method that runs on onRecordSelection. Each record can contain different tabs (specified by each record).
I use this method:

if(jobtype == '1')
{
//show the tab
elements.jobtabpanel.isTabEnabled(6);
//Sets the enabled status for a specific tab
elements.jobtabpanel.setTabEnabled(6,true);
}
else
{
elements.jobtabpanel.removeTabAt(6);
}

Problem is that when the tab is removed in record 1, it doesn’t show up in record 2 when jobtype == 1 …
The tab only appears again when I close and re-open the solution, but that’s no option offcourse :wink:

Enabled <> Visible

When you remove a tab, you cannot show it again… It’s gone.

What you can do re (re)add tabs.. (see the addTab()) function for TabPanels.

Note: You can only add relationless tabs, so you have to manage foundsets yourself.

Paul

I have the same requirements - my solution for now is to remove the text from the tab and disable it. It still shows of course but has no wording or function and because there is no text it is reduced in size to a minimum - not as tidy as removing the tab altogether though!

It would be nice to be able to temporarily make a tab completely invisible without actually removing it.

freecolours:
Problem is that when the tab is removed in record 1, it doesn’t show up in record 2 when jobtype == 1 …
The tab only appears again when I close and re-open the solution, but that’s no option offcourse

form elements has almost nothing todo with records, so if you remove a tab or hide an element, it does not change back when other record is shown