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
Karanbir SinghKaranbir Singh 

How to create a Popup using visualforce ?

I'm new to visualforce and i know a way of creating a popup using javascript. Is there anyother way to create a popup which doesn't involve javascript?

I want my code to be a purely visualforce code 

Best Answer chosen by Karanbir Singh
James WooleyJames Wooley
The only way I'm aware of doing something like this with just visualforce would be to have an apex:outputPanel with a styleclass that made it look like a popup. This would be rendered false when the page first loads, then rerendered as true based on some action on the page.

To do this would require going back to the controller to set a variable that controls the rendering of the outputPanel and might not be the best in terms of user experience. The great thing about javascript is it is all client side. I'd recommend using javascript for a popup as it will result in better user experience.

All Answers

James WooleyJames Wooley
The only way I'm aware of doing something like this with just visualforce would be to have an apex:outputPanel with a styleclass that made it look like a popup. This would be rendered false when the page first loads, then rerendered as true based on some action on the page.

To do this would require going back to the controller to set a variable that controls the rendering of the outputPanel and might not be the best in terms of user experience. The great thing about javascript is it is all client side. I'd recommend using javascript for a popup as it will result in better user experience.
This was selected as the best answer
VinodKRVinodKR
Hi Karanbir,

This link would be ideal one for you because it is step by step explaination for your requirement.

Link - http://www.salesforcegeneral.com/salesforce-modal-dialog-box/

Thanks,

Have a great day ahead!
Let the Force be with you!
Please mark this as best answer if it helps you.
Karanbir SinghKaranbir Singh
Thank you so much James and Vinod :)
Temoc MunozTemoc Munoz
Easy to use and you don't need to re-invent the wheel.

https://jqueryui.com/dialog/
Temoc MunozTemoc Munoz
Just noticed you want a non-Javascript solution. Please disregard my msg
Karanbir SinghKaranbir Singh
It's ok Temoc. I Appreciate your effort :)