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
SS KarthickSS Karthick 

Hide and show output panel

Hi folks,
          Can anyone tell me how to hide and show outpanel
My usecase is:
I have 2 output panel. In the first I have a button when I click on the button the 1st outputpanel should get hide and 2nd one get display.
and same for second output panel

For that how can i write code for visualforce page
Is ther any sample code for this usecase


Thanks in advance
Karthick
Best Answer chosen by SS Karthick
RishavRishav
code sample for this 
<apex:page standardController="case" extensions="QueryStringController" standardStylesheets="false" showHeader="false" >

<apex:form>
<apex:outputPanel id="one" title="one" rendered="{!firstPanel}">
<apex:commandButton value="firstButton" action="{!firstButton}"/>
</apex:outputPanel>

<apex:outputPanel id="two" title="two" rendered="{!secondPanel}">
<apex:commandButton value="SecondButton" action="{!secondButton}"/>
</apex:outputPanel>

  </apex:form>

====================Controller code==============
global with sharing class QueryStringController {
   
   public boolean firstPanel{get;set;}
   public boolean secondPanel{get;set;}
   
    public QueryStringController(ApexPages.StandardController controller) {
     
     firstPanel = true;
     secondPanel = true;

    }


    public void firstButton()
    {
      firstPanel=false;
      secondPanel= true;
    
    }
    public void secondButton()
    {
      firstPanel=true;
      secondPanel=false;
    }


}

I hope your problem will be solved now 

Thanks 
Rishav