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
Brijesh KumarBrijesh Kumar 

open a new window when click "apex:outputLink"

Hi
I am using <apex:outputLink value="">Go</apex:outputLink>
 
when i click Go it should be open a new window not in existing window.
 
I achieve this by using java script but i don't want to use java script.Is there any attribute of<apex:outputLink> such that i open in new window.
 
Please give me a solution
 
Thanks & Regards
Brijesh Kumar Baser
Best Answer chosen by Admin (Salesforce Developers) 
ForcecodeForcecode
Add the attribute target="_blank"

All Answers

ForcecodeForcecode
Add the attribute target="_blank"
This was selected as the best answer
Brijesh KumarBrijesh Kumar
Hi
when i used <apex:outputLink value="{!trip.url}" target="_blank">{!trip.url}</apex:outputLink>

This value of "trip.url" is URL(http://travel.yahoo.com/trip-journal-1676765-italy_2008_my_quarter_life_crisis_trip) with a title name "Italy 2008 My Quarter Life Crisis Trip".

when i click "Italy 2008 My Quarter Life Crisis Trip". then it opens new window by using URL

/Apex/Italy+2008-+My+Quarter+Life+Crisis+Trip

Error shows:The page name can only contain alphanumeric characters, must begin with a letter, and must be unique.

Its not right we want open a new window with URL of title name.

Thanks & Regards
Brijesh Kumar Baser
dchasmandchasman
Are you saying that your trip.url property actually has the URL() in its value? If so, why? Remove that and things should work fine (VF looks for valid protocols/absolute URI's and sees url() and treats that as a relative reference (the browser would have a hard time with this too BTW))...
Becka DBecka D

Forcecode - That is exactly what I needed. Thank you!