Activity Forums Salesforce® Discussions How do we create a popup from VF page?

  • How do we create a popup from VF page?

    Posted by Yogesh on August 9, 2019 at 12:03 pm

    I have a VF page with couple of buttons. I need to show a popup when one of the buttons is clicked. Something like a modal popup where user has to fill in something or click the cancel button in the popup page before to go back to the calling page.

    Piyush replied 4 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Piyush

    Member
    August 12, 2019 at 4:30 am

    Hi Yogesh,

    I am refering an example for popup window:-

    <apex:pageBlock >
    <apex:commandButton value="show popup" action="{!showPopup}" rerender="popup" status="status"/><apex:outputPanel id="popup">

    <apex:outputPanel id="popInnerOutputPnl" styleClass="customPopup" layout="block" rendered="{!displayPopUp}">
    <apex:commandButton value="X" title="Close the popup" action="{!closePopup}" styleClass="closeButton" rerender="popup">
    </apex:commandButton>
    <apex:pageblockSection >

    <apex:pageblockSectionItem >
    <apex:outputLabel value="Email" for="address"></apex:outputLabel>
    <apex:inputField id="address" value="{!Contact.Email}"/>
    </apex:pageblockSectionItem>
    </apex:pageblockSection>
    <apex:commandButton value="Ok" action="{!redirectPopup}" styleClass="closeButton" rerender="popup">
    </apex:commandButton>
    </apex:outputPanel>
    </apex:outputPanel>

    </apex:pageBlock>

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos