+ Start a Discussion

want to open url with parameter in the same tab

Hi, I have an outputlink, and I would like to implement the function that everytime when the link is clicked, then it always opens the redirect visualforce page in the same window or tab. The problem is that the redirect link is not static one like google.dk, it should has paramete cus which defines a specific customer.


I have tried to use window.open(url, target) like the following, but it doesn't work.

<apex:outputLink onlick="window.open('/apex/XX?

&cus={!account.Customer_No__c}', 'sametab')" target="sametab" styleClass="viewLink">click me< /apex:outputLink>


I hope you can help me. Thanks in advance.

Srinath TeramSrinath Teram

Maybe you could try this.


<apex:outputLink value="/apex/XX?&cus={!account.Customer_No__c}"  target="_parent" styleClass="viewLink">click me




Srinath T


No, I don't want to open it in the parent window. I should explain more clearly.


For example I have a AccountA parent window called 'ParentA', and then the link A which has accountA's id as parameter is in the parent window. Let's say first time I click link A, a window/tab called 'child' will be opened. And then I go to AccountB parent window 'ParentB', which also include the link A which has AccountB's id as parameter. Then I wish if I click linkA here, the child page will still opens in the  'child' window/tab, not open in a brand new window/tab.




Please use this code. It might help you


<apex:outputLink onlick="window.self.location.href='/apex/XX?

&cus={!account.Customer_No__c}', 'sametab'" target="sametab" styleClass="viewLink">click me< /apex:outputLink>




If it helps you please mark it as solution.


It doesn't work. I need a popup window, not in the same window.