Obtaining Tab Panel Unique ID from "Whenever Shown" actions

Here’s the easiest way to do it: add an Inline JavaScript Resource to the page that subscribes to the “skuid.tabset.onTabShow” event. This will fire when tabs from any Tab Set are shown, but you can filter out the events to limit to just the Tab Set you’re interested in. For example, assuming that the Tab Set you care about has a Unique Id, e.g. “MyTabSet”, you could do this:

(function(skuid){

skuid.events.subscribe(‘skuid.tabset.onTabShow’,function(e){
   if (e.tabSetComponent.id()===“MyTabSet”) {
      var tabId = e.panel.prop(‘id’);
      window.history.replaceState(
           null,
          “Offender Profile”,
          “Offender_Template?id=” + id + “#” +tabId
      );  
   }
});

})(skuid);

I am assuming here that you’ll be populating the id variable through some other means…

“Whenever Shown” snippets are currently passed any context information about the tab or panel that was shown, so you couldn’t do this right now purely using Whenever Shown snippets or actions. We’ll be adding this context information to the Whenever Shown actions in a future release.