I'm trying to open popup window but I can't.
pagereference ps=new pagereference('/apex/Popupnewpage');
return ps;
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI'm trying to open popup window but I can't.
pagereference ps=new pagereference('/apex/Popupnewpage');
return ps;
You cannot open popup window from controller.
You can either use commandbutton and use oncomplete
method to open a popup
<apex:commandButton action="{!callMethod}" oncomplete="window.open('<url>','_blank','height=400,location=no,resizable=yes,toolbar=no,status=no,menubar=no,scrollbars=1', 1)">
or commandLink to open a popup window
<apex:commandLink
value="Save"
id="cmd1"
target="_blank"
action="{!callMethod}"
onclick=" " />