+ Start a Discussion
Sugandha Kumari 11Sugandha Kumari 11 

On click ,how to render pageblocks in a VF page

How on clicking an Account displayed on VF page ,I can render 2 pageblocks(i.e Contacts and Opportunity)
SandhyaSandhya (Salesforce Developers) 
Hi Sugandha Kumari,

You need to use action support for this.

Please refer below link.

Below is sample code.
<apex:page controller="accext">
   <apex:form >
       <apex:pageblock title="Account with related list">
           <apex:pageBlockTable value="{!accinfor}" var="acc">
               <apex:column >
                   <apex:outputPanel >
                   <apex:actionsupport event="onmouseover" rerender="nani">
                       <apex:param name="cid" value="{!acc.id}"/>
  <apex:outputPanel id="nani">
         <apex:pageBlock >
          <apex:pageblockTable value="{!relatedcontact}" var="rlc">
              <apex:column value="{!rlc.name}"/>

Please refer below links for more information.

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution. 
Thanks and Regards