+ Start a Discussion
azu.shaik1.3965080575576013E12azu.shaik1.3965080575576013E12 

i need to show the iframe when i click on the button Add

<apex:page controller="newemployee" >
<apex:includeScript value="//code.jquery.com/jquery-1.10.1.min.js"/>
<apex:includeScript value="//code.jquery.com/ui/1.10.3/jquery-ui.js"/>
<script>
alert("@@@@@S");
$(document).ready(function(){
  $("#iframes").click(function(){
    $("iframe").hide();
  });

});
</script>
<apex:form >
  <apex:pageBlock id="theBlock">
  <apex:commandButton value="Add"  id="iframes" />
   <apex:iframe frameborder="true" height="200" width="1200" id="iframe" rendered="iframes"/>
     <apex:pageBlockTable value="{!employeeDetails}" var="empDetails">
     <apex:column headerValue="Emp Acccount" value="{!empDetails.EmployeeAccount__c}"/>
     <apex:column headerValue="Name" value="{!empDetails.Employe_name__c}"/>
   </apex:pageBlockTable>
  </apex:pageBlock>
</apex:form>
</apex:page>
sunny522sunny522
Hi azu,
  Go through the example below

apex class:

public class myOppsController
{
private List<Opportunity> opportunities;
public boolean flag{get;set;}
public myOppsController()
{
flag=false;
}

public List<Opportunity> getOpportunities()
{
opportunities = [Select Name, Amount, Account.Name, CloseDate from Opportunity];
flag=true;

return opportunities;
}
public void changevalue(){
system.debug('>>>>>>>>>>>>>>>>'+flag);
flag=true;
system.debug('>>>>>>>>>>>>>>>>'+flag);

}
}

visualforce page :

<apex:page controller="myOppsController" sidebar="false" id="page">
<script>

function ip()
{

test();

}
</script>
<apex:form id="form" >
    <apex:pageBlock id="block1">
    <apex:actionFunction name="test" action="{!changevalue}" reRender="block1"/>
     <apex:commandButton value="Add"  id="iframes" onclick="ip();"/>
   <apex:iframe src="https://www.salesforce.com/" id="theFrame" rendered="{!if(flag==true,true,false)}" />
  
     <apex:variable var="i" value="{!0}"/>
       <apex:pageBlockTable value="{!opportunities}" var="acc">
             <apex:column value="{!acc.Name}" style="background:pink;" onclick="ip('{!i}');"/>
           
        </apex:pageBlockTable>
    </apex:pageBlock>
    </apex:form>
</apex:page>