function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
vikramkkvikramkk 

URL in new window not tab

Hi

 

 How  target="_blank" used in combination with either outputlink or commandlink can be configured to open in a new window or tab? when I use IE browser  with default tab settings as " let  browser decide how popup should be open as a tab or window" the link is always getting opened in new tab but I want it to be opened in new window. For this I don't want to change browser settings. Is this something possible?

 

Thanks

Chamil MadusankaChamil Madusanka

Hi,

 

Use following,

 

 

<apex:outputLink value="your URL" target="_blank">Edit</apex:outputLink>

 This will work in IE properly. But in firefox, it will be a new tab.

 

Check your IE Tab settings;

           Tools>Internet Options>General>Tabs>Settings>

 

If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.

 

Chamil's Blog

sfdcfoxsfdcfox

 

<apex:page >
    <apex:outputLink value="http://www.google.com/" target="_blank">New (default action)</apex:outputLink><br/>
    <apex:outputLink value="http://www.google.com/" onclick="window.open(this.href,'a'+Math.random(),'width=600,height=400,status=1,scrollbars=1,location=1'); return false">New Window (regardless)</apex:outputLink>
</apex:page>

The former will use the settings set forth by the user, while the latter will (should) always open up in a new window. The name attribute is randomized to reduce the chance of a named window already having the same name.