Newer Version Available
Using Page References to Open Console Workspace Tabs and Subtabs
- Future-proofs your apps from changes in URL formats.
- Generates a user-friendly URL for your tabs.
- Opens an Aura component as a subtab, even if called from a utility, a hover, or another page.
- Allows a mechanism to conditionally open a given component more than once or redirect to an already open workspace or subtab using the uid parameter.
The controller openGreetingsController.js uses openSubtab() and sets c__name to the value of the myname input field. You can use the uid parameter to conditionally dedupe tabs and subtabs. Omit the uid to open a new tab or subtab every time.
Now that we have everything set up, we can test our components by creating a custom tab in Setup for openGreetings.cmp. Add the custom tab to a console app and open the console app. Select the custom tab from the nav menu to open openGreetings.cmp. Enter a name and click “Open Geeting in Subtab.” greetings.cmp opens as a subtab and displays its greeting with the provided name.