+ Start a Discussion
Alejandro Garcia LopezAlejandro Garcia Lopez 

Open pageReference page in a new window

hello, i'm trying to open a new visualforce from a button and it works, the problem is that i need to open it in a new window, not in te same page, is it possible to do that?
first i was doing this:
<button id="vpre" hidden="hidden" type="button" onClick="window.open('/apex/vistaauth?ida='{!res},'Vista Previa','width=700,height=650');">V. Previa</button>
and it work very well but i cant pass values from the controller to the new vf

now i can pass them but i cant set the new page in a new window or customize the size
public PageReference abrir()
{   
       PageReference pageRef= new PageReference('/apex/vistaauth');
       pageRef.getParameters().put('tp', tipoo);
       pageRef.setRedirect(true);        
       return pageRef;           
   }


 
karthikeyan perumalkarthikeyan perumal
Hello, 

can you post your VF page code here? 

Thanks
karthik
 
Karthi XaviKarthi Xavi
Hi,
Below links could help you,
https://developer.salesforce.com/forums/?id=906F000000096XFIAY
http://salesforce.stackexchange.com/questions/40929/commandbutton-target

Thanks,
Karthi.
RepsGRepsG
instead of onclick, use oncomplete and reference the variable from your controller.