Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
error

We made a wrong turn. Try again.

Hello all,

I'd like to know if there is a way to open an apex:tab element in a new window when the tab header is clicked.

Currently, I have a way to link directly to a specific tab on my Visualforce page using a page parameter. However, I'm having trouble with my implementation.

My desired functionality is as such:

  • When a tab header is clicked, do not go to that page.
  • Instead, a new window will open directly to that tab header.

What I've tried so far:

onclick="window.open('/apex/pagename?tab=tabname','_blank');" disabled="true"

This causes nothing to happen when header is clicked.

 

onclick="window.open('/apex/pagename?tab=tabname','_blank');"

This causes the tab to function in the standard way - opens in the current tab without carrying over the parameters in the URL.

 

ontabEnter="window.open('/apex/pagename?tab=tabname','_blank');"

This causes the tab to open in a new window as desired, carrying over the parameters; however, the original window still loads the new tab instead of staying on the previous tab.

Any help is much appreciated.

Thank you.

 
1 answer
  1. Oct 27, 2015, 3:43 AM
    There is some inherent JS running with those tabs, so trying to override them in the control itself won't work - you may be able to override them with some jQuery or something.  Failing that - you may want to use some jQueryUI tabs and run your own UI.
0/9000