1

In the below code. I want to display pop up if one of field on application object is not checked. And allow user to check the field and update the record on click of Open If checked then display page directly. Problem faced:- The input checkbox field not displaying in popup window. And popup is always display even if rendered condition is given.

Pop up to be rendered only if application.accept_t_c is false

<apex:page showHeader="false" sidebar="false" id="page" extensions="PopupTest" standardController="Application__c">    <style type="text/css">
     .firstVisitPopup
    {
        background-color: white;
        border-width: 2px;
        border-style: solid;
        z-index: 9999;
        left: 50%;
        padding:10px;
        position: absolute;
        width: 500px;
        margin-left: -250px;
        top:100px;
    }
    .popupBackground
    {
        background-color:Black;
        opacity: 0.20;
        filter: alpha(opacity = 20);
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        z-index: 9998;
    }</style>  <apex:form ><apex:inputField value="{!application.Name}"/>   <apex:outputPanel id="FirstVisitMessage" rendered="{!(application.Accept_T_C__c == false)}">
<apex:outputPanel styleClass="popupBackground" layout="block" rendered="{!(application.Accept_T_C__c == false)}"/>
<apex:outputPanel styleClass="firstVisitPopup" layout="block" rendered="{!(application.Accept_T_C__c == false)}">
<apex:pageBlock id="pbfirstvisit"> 
<apex:outputText value="WELCOME" /><br/><br/>
<apex:outputText value="Note: test test test test test test" />
<br/><br/><br/><br/> 
<apex:outputText value="TERMS AND CONDITIONS" /><br/><br/>
<apex:outputText value="terms...." />
<br/><br/>
<apex:inputCheckbox value="{!application.Accept_T_C__c}"/>
<div style="float:right"> 
    <apex:commandButton value="OPEN" action="{!closePopup}" / >
</div>
</apex:pageBlock>
</apex:outputPanel>
</apex:outputPanel>
</apex:form></apex:page>

Class code

public with sharing class PopupTest{

public string applicationId {get;set;}

public Application__c application{get; set;}

public PopupTest(ApexPages.StandardController stdCtrl) 
{
    applicationId = ApexPages.currentPage().getParameters().get('Id');

    application = [SELECT Id, Name, Accept_T_C__c
                    FROM Application__c
                    WHERE Id = : applicationId]; 
    system.debug('## application' + application);   
}


public void closePopup() 
{        
    update (this.application);

}  }
2
  • Are you getting any exception ?
    – Ashwani
    Oct 7, 2013 at 10:07
  • Nops no exception
    – TestNS
    Oct 7, 2013 at 10:12

0

You must log in to answer this question.

Browse other questions tagged .