Tab control API
Open, navigate, focus, and list controlled tabs.
Docs updated: 2026-03-24
openTab
openTab creates a controlled tab (or reuses an existing one) and associates it with your tabKey.
7.13.0 behavior
Keep one stable
tabKey per workflow.
openTab is now serialized per key, so two near-simultaneous calls with the same tabKey no longer race into duplicate tabs.
// Open (or reuse) a controlled tab
await RTOForm.openTab(
{
"tabKey": "billing",
"url": "https://example.com/billing",
"focus": true,
"newTab": true
},
{ "timeoutMs": 20000 }
);
focusTab / closeTab
// Focus a tab
await RTOForm.focusTab({ "tabKey": "billing" });
// Close a tab
await RTOForm.closeTab({ "tabKey": "billing" });
listTabs
Useful for dashboards and UI lists. If you want a normalized response shape, use RTO_tabsList.js.
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_tabsList.js"></script>
<script>
(async function(){
// List controlled tabs (raw)
const res = await RTOForm.listTabs({}, { timeoutMs: 4000 });
console.log("raw:", res);
// Easier: use RTOTabsList (normalizes the response)
const snap = await RTOTabsList.requestNow(4000);
console.log("items:", snap.items);
console.log("byKey:", snap.byKey);
})();
</script>
UI helpers
If you do not want to write click handlers, RTO_openTab_button.js can bind buttons with data-attributes.
When the target tab is already open, the helper prefers focusTab and does not announce a fake “open” state too early.
<!-- Button that opens (or focuses) a tab -->
<button
data-rto-url="https://example.com/billing"
data-rto-tabKey="billing"
data-rto-open-focus="1"
data-rto-when-open="focus"
>
Open billing
</button>
<script src="../RTO_helpers/RTO_form_api.js"></script>
<script src="../RTO_helpers/RTO_connector.js"></script>
<script src="../RTO_helpers/RTO_openTab_button.js"></script>
<script>
RTOconnectOnce(1500).then(function(){
RTObindTabButtons();
});
</script>