You need to sign in to do that
Don't have an account?

Display Account details on Modal Popup in Visualforce
Hi all,
I am new to Visualforce. I want to display Account records, then when we click on the name, a popup box (Modal Popup only) should be opened displaying the name and phone number.
Below is my code.
Popup is not showing up and I don't understand how to display records on a popup. Please help me. Thanks.
I am new to Visualforce. I want to display Account records, then when we click on the name, a popup box (Modal Popup only) should be opened displaying the name and phone number.
Below is my code.
<apex:page standardController="Account" recordSetVar="accnt" tabStyle="Account" > <script type="text/javascript"> var popupbox = new SimpleDialog("Test", true); popupbox = createDialog(); function OpenPopup(){ popupbox.setTitle("Account Detail"); popupbox.importContentNode(document.getElement.Id("{!$Component.popupbox}")); popupbox.show(); } OpenPopup(); </script> <apex:form > <apex:outputPanel style="display:none"> <apex:outputPanel id="popupbox" layout="block"> <p>Click OK to Cancel...</p> <apex:commandButton value="Ok" onClick="popupbox.hide()" /> </apex:outputPanel> </apex:outputPanel> <apex:pageBlock title="Accounts" > <apex:pageBlockTable value="{!accnt}" var="ac" > <apex:column id="two"> <apex:commandButton value="Click" onclick="OpenPopup();" reRender="two"/> </apex:column> <apex:column value="{!ac.Name}" /> <apex:column value="{!ac.AccountNumber}" /> <apex:column value="{!ac.Type}" /> <apex:column value="{!ac.Rating}" /> <apex:column value="{!ac.Phone}" /> <apex:column value="{!ac.billingCity}" /> <apex:column value="{!ac.billingCountry}" /> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
Popup is not showing up and I don't understand how to display records on a popup. Please help me. Thanks.
first create apex class :
vf page :
Output :
i hope it helps you.
kindly Let me inform if it helps you and close your query by choosing best answer if you got your right answer so it can helps others
thanks
sfdcmonkey.com
All Answers
first create apex class :
vf page :
Output :
i hope it helps you.
kindly Let me inform if it helps you and close your query by choosing best answer if you got your right answer so it can helps others
thanks
sfdcmonkey.com
Awesome :) Thanks for the detailed solution. Helps a lot!
If I want to achieve this objective through JavaScript then what modifications I have to make in my code? I will be highly obliged for your help.
kindly close this query with choosing best answer and regading javaScript version please put a new query on forums with your code so everyone can take a look into it :)
Thanks