-
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
What is Pardot in Salesforce and Does Your Business Need it in 2024?
Many businesses consider marketing automation to be a must-have. According to the latest Salesforce State of Marketing Report, the average enterprise has 900 (!) different applications…
Low-Code Salesforce REST API Integration - All You Need to Know
Salesforce offers a REST API that allows you to integrate with third-party applications. This guide illustrates how to integrate with Linx, a low-code application development…
What is Salesforce Integration and Its Architecture Types in 2024?
Salesforce Integration and Its Architecture Types Salesforce's integration combines two or more systems that allow users to streamline different processes. Every integration aims to ensure…
Popular Salesforce Videos
How to Get Experience Without the Job? | Salesforce Learning
Want to get experience without the job? Watch the full episode here: https://youtu.be/oG8sHOW8GI4 Shrey is a Chief Executive Officer at Cyntexa, a SILVER Salesforce Consulting…
Salesforce Marketing Cloud Tutorial | Online Training
Salesforce Marketing Cloud (SFMC) is Salesforce’s platform (or “Cloud”) in the area of marketing automation and customer engagement. It is a SaaS platform made up…
Salesforce - Sage ERP Integration
Salesforce Integration with Sage ERP (SageX3 / Sage100 / Sage300) delivers seamless, real-time, bi-directional integration that plays a pivotal role in unlocking the potential of…