Controlling the Visibility of Custom Tabs
- Last UpdatedNov 14, 2022
- 1 minute read
If there is a requirement for new tabs to be visible to only to particular users, for example, only when working on a given project, or only when you are in a given team, this can be done by creating a command object and linking it to the tab using the tab Command property. Once a command object is linked to a tab, its visibility can be controlled directly from another piece of code either by calling its visible method, or by implementing a refresh method on the tab command object and using the refresh event and refresh filters to listen for the INITIALISED event. The refresh method performs the test to determine the visible state of the tab and sets the visibility of the tab by using the command visible method.
Tab visibility can be changed at any time according to a context. For example, if a tab should only appear when a given state button is checked, then the command linked to that button can either control the visibility of the tab directly by calling its visible method, or use the !!CMSYS setApplicationContext method to send a message to the refresh method of the tab command.