Hi Community,
I need to trigger an event when opening a tab in an edit page.
For example in account page, when user clicks on "Contacts" tab, i will trigger a custom method. Is there any OOB method which I can override to handle this event. Any idea please?
Thanks
Like
Hello Fulgen,
In the BasePageV2 you can find the method activeTabChange, it triggers every time you change the tab and you can override it on any [Object]PageV2:
activeTabChange: function(activeTab) { this.callParent(arguments); console.log("Hello World"); },
Thanks Dmytro,
One more thing, I've noticed this code (var tabName = this.get("ActiveTabName");) is giving the previous active tab not the current one. How can I get the name of currently selected tab?
Take a look at the argument activeTab. Inside it, you can find information about a new tab.
activeTab.values.Caption