We can make use of alert() in javascript to display the pop in Visualforce page. But there another pop up box which looks pretty good and it is providing by Salesforce.
Below is the code to create a pop up box in Visualforce :
Below is the code to create a pop up box in Visualforce :
<apex:page >
<script type="text/javascript">
document.body.style.cursor="auto";
var box=new SimpleDialog("Test", true);
box.setTitle("Test Pop up");
box.createDialog();
box.setContentInnerHTML("<b>Praveen</b><input type=\"button\" value=\"Ok\" onclick=\"javascript:box.hide();\"/>");
box.show();
</script>
</apex:page>
|
Hi Praveen Kumar K,
ReplyDeleteReally useful code.Thanks for sharing.
One question- is this, functionality of sfdc or it is custom one?
Regards,
Santosh
It is the SFDC standard popup box and it works only if the header is true in VF page
DeleteIt is the standard salesforce pop up.. we can use this in VF pages and custom buttons which calls javascript as an action.
ReplyDeleteNote : page header should be visible to execute this pop up code.
Page is refreshing once i click on the button to open the popup.
ReplyDeleteThere must be some error in the javascript like semi-colon missing or some syntax errors.
Delete