You can use the tab.setEnabledAt (index, false) method to disable the tab if validation = false, and tab.setEnabledAt (index, true) to enable it when validation = true.
Edit: disabling the tab will be grayed out so that the user cannot click on it in the first place, which means that you will need to perform a validation check before the user clicks the tab.
source
share