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
aditya3aditya3 

Show/Hide the section in the vf page

Hi ,
I am working on vf pages in that I am having the task section as shown in the below,I want to show the sections of  Items and attachments when clicking the arrow adjust to the attachments .How can I achieve this
please follow the screenshot

Thanks in advance
task section
 
salesforce mesalesforce me
Hi aditya check this once..
 
<apex:page controller="TestPage4">
  
  <apex:form >
      <apex:pageBlock id="block">
          <apex:pageBlockSection title="Section 1" rendered="{!showSection1}">
          
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Section 2" rendered="{!showSection2}">
          
          </apex:pageBlockSection>
          <apex:pageBlockSection title="Section 3" rendered="{!showSection3}">
          
          </apex:pageBlockSection>
      </apex:pageBlock>
      
      <apex:commandButton action="{!method1}" value="Button1" reRender="block"/>
      <apex:commandButton action="{!method2}" value="Button2" reRender="block"/>
  </apex:form>
</apex:page>
 
public with sharing class TestPage4 {
    public Boolean showSection1{get;set;}
     public Boolean showSection2{get;set;}
     public Boolean showSection3{get;set;}
     
     public TestPage4 ()
     {
         showSection1= false;
        showSection2= true;
        showSection3 = true;
     }

    public PageReference method2() {
       showSection1= true;
        showSection2= false;
        showSection3 = true;
        return null;
    }


    public PageReference method1() {
        showSection1= false;
        showSection2= true;
        showSection3 = false;
        return null;
    }

}