-
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
7 Salesforce Podcasts to Listen To in 2022-2023
If you work in Sales or Marketing, there’s no way you haven’t at least heard of the customer relationship management tool Salesforce. This software allows…
Advice on Launching a Lucrative Career as a Salesforce Consultant
What is a Salesforce Consultant? When adopting Salesforce within an organization, Salesforce consultants are necessary. They support Salesforce project design, planning, and implementation. A thorough…
What does a Salesforce Professional Do? Exploring Salesforce Roles and Profiles
There are a number of articles and blogs out there discussing the demand, the salaries, or the need for certification for a Salesforce professional. But…
Popular Salesforce Videos
Mastering Apex Collections | Salesforce Tutorial
Working with collections like List, Map and Set is part of the day’s routine for Apex developers. While their basic use is straightforward, there are…
Customizing and Replacing Sample Salesforce Data
Leverage our sample use case for Salesforce to learn how HyperIntelligence works—and rapidly get your own cards up and running! In this video, we’ll demonstrate…
Salesforce Essentials
Watch this video to learn what customer relationship management (CRM) is and how CRM helps companies better engage with prospects and customers, streamline communications, and…