how to set a tab from controller in lightning com code example
Example: how to set a tab from controller in lightning com
var selected = component.get("v.key"); //key used for storing tab ids.
component.find("tabs").set("v.selectedTabId",selected);