-
pageblockSection is not rendered on click of commandButton
I want to show the description of account on click of name
VF page;-
<apex:page controller="SearchAccountCon" tabStyle="account">
<apex:form >
<apex:inputText value="{!searchString}" label="Search"/>
<apex:commandButton value="search" action="{!search}"/>
</apex:form>
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!acct}" var="a" >
<apex:column >
<apex:commandLink value="{!a.Name}" action="{!showdetails}" rerender="RID" >
</apex:commandLink>
<apex:pageBlock id="RID">
<apex:pageBlockTable value="{!acct}" var="b" rendered="{!showSection1}">
<apex:column value="{!b.description}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>apex class;
public class SearchAccountCon {
public static String searchString {get; set; }
public Boolean showSection1{get;set;}
public static String Id {get; set; }
public static List<Account> acct{get;set;}
public String showleadid { get; set; }public SearchAccountCon(){
showSection1 = false;
}public static void search(){
try{
acct= Database.query('Select Name, description,(select LastName From Contacts) From Account WHERE Name LIKE \'%'+searchString+'%\' Limit 100');
system.debug('ddd'+acct);
}
catch(Exception e){
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter Account site'));
}
}public void showdetails() {
if(showSection1== true){
showSection1= false;
}else{
showSection1= true;
}
}}
Log In to reply.
Popular Salesforce Blogs

How Salesforce Customization Services Can Help Your Business
Salesforce is known to have thousands of features used by businesses, along with customization options. Off-the-shelf Salesforce solutions might initially help a business but, moving…

4 Tips on How Salesforce Professionals Can Improve Their Communication Skills
There’s a reason “Communication is key” is such a popular saying. Effective communication is an important soft skill in the workplace and is the key…

What is Salesforce Service Cloud and What are its Features?
This area of the Salesforce platform is dedicated to giving clients assistance and support. Customers are more satisfied and loyal as a result, which aids…
Popular Salesforce Videos
Salesforce Einstein Keynote: Meet Your Smart CRM Assistant
Salesforce Einstein is your smart CRM assistant, making your employees smarter and your customers happier. With Einstein, everyone has an AI-powered assistant to help them…
Getting Started With The Ant Migration Tool in Salesforce
Ant Migration Tool In Salesforce. In this video, the following points will be covered - 1. Introduction Get a brief introduction about the Ant Migration…
5 Mind-Blowing New Salesforce Marketing Cloud Releases
The Statist worldwide marking survey reports- “Almost 4 billion world population is digitally active, and 2.14 of them are shopping online.” In this entire scenario,…