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
JakemJakem 

outputLink in pageBlockTable displaying in section

Hi everyone,

 

Sorry if this is a stupid question but here goes. I have a visualforce page that displays a custom table of child objects related to Opportunities and one of the columns is an outputLink to the child object page. The link is based on a lookup field. My page is imbedded in a section of a standard page layout. My problem is that when I click the link, the page I want to redirect to displays in the section in the Opportunity page instead of the full window. 

 

Here is my VF code (unnecessary stuff removed):

 

<apex:page standardController="Opportunity" extensions="AllocateBudgetextension" id="opportunity" showHeader="false" sidebar="false" standardStylesheets="true">
<apex:form >
<apex:pageBlock id="block" mode="maindetail">
<apex:pageBlockSection columns="1">
<apex:outputPanel id="table">

<apex:pageBlockTable value="{!CampaignListDummys}" var="dummy" rendered="{!(CampaignListDummys.size != 0)}" style="margin-bottom:5px">
<apex:column headerValue="Action" width="50px">
<apex:commandLink action="{!removeCampaign}" reRender="table">
<apex:param name="cid" value="{!dummy.budgets.Id}" assignTo="{!dcbid}"/>Remove
</apex:commandLink>
</apex:column>
<apex:column headerValue="Allocation" width="110px">
<apex:outputField value="{!dummy.budgets.Budget__c}" rendered="{!NOT(editmode)}"/>
<apex:inputField value="{!dummy.budgets.Budget__c}" rendered="{!editmode}" style="height:11px;margin:-1px;width:100px"/>
</apex:column>
<apex:column headerValue="Campaign" id="campaign">
<apex:outputField value="{!dummy.budgets.Advertiser_Campaign__c}" rendered="{!NOT(editmode)}"/>
<apex:selectList value="{!dummy.budgets.Advertiser_Campaign__c}" size="1" rendered="{!editmode}" style="font-size:8px;margin:-1px">
<apex:selectOptions value="{!CampaignOptions}"/>
</apex:selectList>
</apex:column>
<apex:column headerValue="Inventory Type" width="101px">
<apex:outputText value="{!dummy.campaigns.Inventory_Type__c}" rendered="true"/>
</apex:column>
</apex:pageBlockTable>
<apex:outputPanel>
<apex:commandLink value="Allocate" action="{!newCampaignBudget}" reRender="table"/>
</apex:outputPanel>
</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

  

 

I hope this makes sense. Any ideas?

Best Answer chosen by Admin (Salesforce Developers) 
JakemJakem

Yes, using target="_top" worked.

All Answers

Navatar_DbSupNavatar_DbSup

Hi,

      Have You tried target attribute with <apex:outputlink>?You can assign target="_self" with apex:outputlink.It may help you.

 

<apex:outputlink target="_self"  value="Remove"/>

 

 Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

JakemJakem

Thanks for your response. I tried the target attribute but I sitll have the same problem. The code now looks like this:

 

<apex:column headerValue="Campaign" id="campaign">
                    <apex:outputLink value="/{!dummy.budgets.Advertiser_Campaign__c}" rendered="{!NOT(editmode)}" target="_self">{!dummy.campaigns.Name}</apex:outputLink>
                    <apex:selectList value="{!dummy.budgets.Advertiser_Campaign__c}" size="1" rendered="{!editmode}" style="font-size:8px;margin:-1px">
                        <apex:selectOptions value="{!CampaignOptions}"/>
                    </apex:selectList>
                </apex:column>

 

The link to the Advertiser Campaign object still opens in the section of the page.

 

JakemJakem

Bump

 

I've seen this asked a few times but no one ever answers. Is there possibly a javascript solution?

nyhansanyhansa

Hi Jakem,

 

Did you ever find a solution to this?

 

Thanks!

 

Sam

JakemJakem

Yes, using target="_top" worked.

This was selected as the best answer
nyhansanyhansa

Thank you so much! It worked perfectly!

Aditya PatilAditya Patil
Thank you! It worked! Is there a way to open it in a new tab\window?