[SalesForce] How to change the width (or the size) of a visualforce page

I have a visualforce page, in which I have a button that open a new visualforce page.

The problem I have is that the new page is too small (like a popup), and I want to set the width of my new page. It is possible ? And how can I do that ?

Thanks 🙂

Code

<apex:commandButton value="Enregistrer" action="{!enregistrer}" 
   onclick="enregistrerBlocks()" oncomplete="CloseAndRefresh()" rerender="msg"/>

Best Answer

Assuming you are using window.open, set the width and height

window.open("http://www.w3schools.com", "_blank", "width=400, height=400");

http://www.w3schools.com/jsref/met_win_open.asp


<!DOCTYPE html>
<html>
<body>
<a href="#" onclick="window.open('http://www.w3schools.com/', 'newwindow', 'width=300, height=250'); return false;">
   Click here to open new window
</a>
</body>
</html>

Use this code implement here http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_open

<apex:commandButton value="Click Me" action = "{!method2}" 
 oncomplete="window.open('http://www.w3schools.com', '_blank', 'width=400, height=400');"/>
Related Topic