+ Start a Discussion
Vipin  PulinholyVipin Pulinholy 

Issue with outputLink window.open in IE

I have this code in my VF page

<apex:outputLink onclick="window.open('/apex/myLastActivity?id={!m.Id}','LastActivity','width=610,height=170,toolbar=0,status=1,scrollbars=1,resizable=yes')" >{!n.Subject}</apex:outputLink>

 

When I click this 'Subject' link a new popup winodw should open. It works perfectly in Firefox. But in IE after I click this link it opens the new window and after that the main page (parent page) automatically refreshes to the following link:

 

https://c.cs3.visual.force.com/apex/

 

 And I get the "URL No Longer Exists
You have attempted to reach a URL that no longer exists on salesforce.com..... " Message.

 

Do any body know how to fix this issue?

 

Best Answer chosen by Admin (Salesforce Developers) 
aballardaballard

I'm surprised it works in firefox. 

 

The problem is that after executing the onclick, it does the normal action of a link which is to request the url specified by the value attribute.. in this case blank, so it requests an invalid/non-existent page.

 

You can either suppress the default action by endign the onclick with "return false", or you can give the link a value of "#" to leave it on the same page. 

 

 

All Answers

aballardaballard

I'm surprised it works in firefox. 

 

The problem is that after executing the onclick, it does the normal action of a link which is to request the url specified by the value attribute.. in this case blank, so it requests an invalid/non-existent page.

 

You can either suppress the default action by endign the onclick with "return false", or you can give the link a value of "#" to leave it on the same page. 

 

 

This was selected as the best answer
Vipin  PulinholyVipin Pulinholy
Ok. that workded.value="#" worked. Thank You.