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
SS KarthickSS Karthick 

Displaying Information in Custom Popup window

Hi folks,
          Can anyone tell me how to display the information in custom popup window??

I have to display the information(Name and products) from my custom object Product_Item__c (Which contains Name and products) based on the product items clicked
My Visualforce Page:

<apex:page standardController="Product_Item__c" recordSetVar="pro" extensions="popup">
    <apex:form >
         <apex:pageBlock title="Product Item Records" >
            <apex:pageblocksection title="Product Item Name" columns="2">
                <apex:repeat value="{!pro}" var="pr">
                    <apex:pageblocksectionitem >
                        <apex:outputLabel >
                            <apex:commandLink rerender="popup" action="{!showPopup}">
                                {!pr.Name}
                               
                                 <apex:param name="param1" assignTo="{!param1}" value="{!pr.Id}"/>
                            </apex:commandLink>
                           
                        </apex:outputLabel>
                 
                    </apex:pageblocksectionitem>
                </apex:repeat>
            </apex:pageblocksection>             
        </apex:pageBlock>

        <apex:outputPanel id="popup">
            <apex:outputPanel styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
             
   Product Information <br/>
               
             
                <apex:repeat value="{!productRecords}" var="pr1">
                 {!pr1.Name}
                    {!pr1.Product__c }
                 </apex:repeat>
                   
              
                <apex:commandButton value="Hide Pop up" action="{!closePopup}" rerender="popup"/>
            </apex:outputPanel>
        </apex:outputPanel>

    </apex:form>

    <style type="text/css">
       .customPopup{
            background-color: white;
            border-style: solid;
            border-width: 2px;
            left: 50%;
            padding:10px;
            position: absolute;
                    
            width: 500px;
            margin-left: -250px;
            top:100px;
        }
    </style>
</apex:page>







Extention:
public class popup {

    public popup() {

    }
    public ID param1 { get; set; }
    public List<Product_Item__c> productRecords{get;set;}
    Id reocrdId=ApexPages.currentPage().getParameters().get('id');
     Id i = System.currentPageReference().getParameters().get('id');
    public popup(ApexPages.StandardSetController controller) {
        productRecords=new List<Product_Item__c>();
        productRecords=[select Id,Name,Product__c from Product_Item__c where Id=:param1];
    }


    public boolean displayPopup {get; set;}

    public void closePopup() {
        displayPopup = false;
    }

    public void showPopup() {
        displayPopup = true;
    }
}


The page Displays only the product Information in popup window as I Highlighted above .....
It doesnt display name and products



Thanks in advance
Karthick
Best Answer chosen by SS Karthick
Karthick RajaKarthick Raja
Refer this link(salesforce.stackexchange.com/questions/17762/show-pop-up-on-visualforce-page)