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
raghu123raghu123 

Vf page in new Browser tab or page...??

Hi Everybody,

                         I created two vf pages  say page1,page2 .. When i click a button in page1.page 2 should open in new browser tab or newpage . Can anyone help me on this please..??

Thank You

 

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

Sounds like you need an onclick handler for the button press that invokes a javascript function.  This function can then use the window.open function to create the new window you desire.

All Answers

bob_buzzardbob_buzzard

Sounds like you need an onclick handler for the button press that invokes a javascript function.  This function can then use the window.open function to create the new window you desire.

This was selected as the best answer
raghu123raghu123

Thanx Bob,

                       I am not succed.Can you help me out.

<script language="text/javascript"> 
 var popup; 
 function showNewtab()
  {  
  popup = window.open("http://www.google.com")
   } 
</script> 

<apex:commandButton value="Return Order" action="{!xyz}"  onClick="showNewtab()"/>

 

Thank You, 

raghu123raghu123

ThankYou BOB. Its Worked for me...:)))))