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
Nikki_tcsNikki_tcs 

How to display detail text/content in a new tab/window

Hi,

 

I would like to display the detailed content in the new tab when user clicks on the title. What is that i have to include in the visualforce code, so that the content just open up in a new tab or window. Currently i have the following code which open the content in the same page / tab.

 

 

<apex:actionFunction action="{!loadSimilar}" name="javascriptLoadSimilar" rerender="similarResults" />

<apex:outputPanel layout="none" rendered="{!hasSimilarCnt}">
Possibly similar Cnt:
<apex:dataList value="{!similarCnt}" var="similarCnt">
									<ideas:detailOutputLink page="{!empPage}" Id="{!similarCnt.id}">{!similarCnt.title}</ideas:detailOutputLink>
</apex:dataList>
</apex:outputPanel>

 

 

 Thanks,

   Nik

Best Answer chosen by Admin (Salesforce Developers) 
EIE50EIE50

Hi Nik,

 

Try this,

 

<apex:actionFunction action="{!loadSimilar}" name="javascriptLoadSimilar" rerender="similarResults" />

<apex:outputPanel layout="none" rendered="{!hasSimilarCnt}">
Possibly similar Cnt:
<apex:dataList value="{!similarCnt}" var="similarCnt">
<ideas:detailOutputLink page="{!empPage}" Id="{!similarCnt.id}"> <a href="{!empPage}" target="_blank"> {!similarCnt.title} </a> </ideas:detailOutputLink>
</apex:dataList>
</apex:outputPanel>

 

 

All Answers

Ispita_NavatarIspita_Navatar

In order to display your page in a new window you need to set the target of an anchor tag or in case of Apex in HYPERLINK() function as _BLANK. In your example you are using detailOutputLink which does not take a target attribute so I would suggest why don't you generate an anchor tag as in a visual force page one can even use HTML tags and then set the target attribute as _BLANK.

 

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

EIE50EIE50

Hi Nik,

 

Try this,

 

<apex:actionFunction action="{!loadSimilar}" name="javascriptLoadSimilar" rerender="similarResults" />

<apex:outputPanel layout="none" rendered="{!hasSimilarCnt}">
Possibly similar Cnt:
<apex:dataList value="{!similarCnt}" var="similarCnt">
<ideas:detailOutputLink page="{!empPage}" Id="{!similarCnt.id}"> <a href="{!empPage}" target="_blank"> {!similarCnt.title} </a> </ideas:detailOutputLink>
</apex:dataList>
</apex:outputPanel>

 

 

This was selected as the best answer