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
Chitral ChaddaChitral Chadda 

how to open page refernce in new window

<apex:page standardController="Account" showHeader="true">
<p>Hello {! $User.FirstName}!</p>
<p>You are viewing the {! account.name} account.</p>
<apex:outputLink value="{! $Page.MyFormContact}">Create New Contact!</apex:outputLink>

<apex:pageBlock >
<apex:pageBlockTable value="{! account.contacts}" var="item">
<apex:column value="{! item.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>


 i have added this accountdisplay in the page layout.
when account details open and when  i click  create new contact (in accountdiaplay section ), the window for contact opens but its size is small(section specified ) , how to make it open in a new window when i click create new contact
Best Answer chosen by Chitral Chadda
Denis VakulishinDenis Vakulishin
<apex:outputLink value="{! $Page.MyFormContact}" target="_blank">Create New Contact!</apex:outputLink>

All Answers

Denis VakulishinDenis Vakulishin
Add the attribute target="_blank"
Grazitti TeamGrazitti Team
Instead of using the apex:outputlink you can use plain html <a> tag and use javascript to open the [age in new window:

<apex:page setup="false" standardController="Account" showHeader="true">
<script type="text/javascript">
    function openCreateContact() {
        window.open("{!$Page.MyFormContact}");
    }
</script>
<p>Hello {! $User.FirstName}!</p>
<p>You are viewing the {! account.name} account.</p>
<a href="javascript:void(0);" onclick="openCreateContact();">Create New Contact!</a>

<apex:pageBlock >
<apex:pageBlockTable value="{! account.contacts}" var="item">
<apex:column value="{! item.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
 </apex:page>





Chitral ChaddaChitral Chadda

@grazitti

i m not familiar to java script .

Chitral ChaddaChitral Chadda
@denis
where do i add this attribute in the code
Denis VakulishinDenis Vakulishin
<apex:outputLink value="{! $Page.MyFormContact}" target="_blank">Create New Contact!</apex:outputLink>

This was selected as the best answer
Chitral ChaddaChitral Chadda
thankyou denis . :)
Chitral ChaddaChitral Chadda
@denis could u help me know the basic use of    : target="_blank"
Denis VakulishinDenis Vakulishin
All visualforce controls renders to HTML controls, so apex:outputLink renders to simple <a> tag,
You could look at w3s for more information about standard HTML  attributes and tags.
http://www.w3schools.com/tags/att_a_target.asp
Look at this and let me know if you don't understand something.