How to edit Tab strip's tab data property value using script

Hi Guys,

Can anyone help me on how can I edit the Tab Strip’s tab data property value via scripting?
I’m thinking to create a Client event script that will edit the value (dataset) of the tab data property of a tab strip component. What I’m trying to do is to hide the tabs that will not be used for a specific client/user.
I saw that it’s possible to hide the tabs by accessing the tab data property value and find the row of the tab you want to hide, then under hidden column just tick it. But I want to do this in script.
Anyone knows how to do it?

See attached file for additional information.

Hope you can help me with this guys.

Thanks in advance.


You have to edit the dataset.

tabToHide = "Tab 3" ts = event.source.parent.getComponent('Tab Strip') ds = ts.tabData for row in range(ds.rowCount): if ds.getValueAt(row, "NAME") == tabToHide: ds = system.dataset.updateRow(ds, row, {"HIDDEN": True}) break ts.tabData = ds

Note that normally modifying a set that you are iterating through is a very bad idea and will almost always cause unintended results but in this case I am exiting the loop immediately after modifying the dataset.

1 Like

@JGJohnson

Thanks, I’ll try it. Will this script also work when I put it in Client Event Script?
This is where I want to put it.


I don’t know if it would work or not (my guess is not) but I would recommend putting it in the internalFrameActivated event of the window that contains the tab strip.

I’m guessing you probably have a client tag that you use to determine if the tab should be hidden or not. You can read the value of that tag in the event and run the script if appropriate.