-
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 Technology is Changing Marketing and Customer Engagement
How Technology Will Change Marketing and Customer Engagement The application of artificial intelligence or AI to many business processes seems limitless now that we continue…
Key Salesforce Benefits for Healthcare
During the peak of COVID-19, the importance of a streamlined workflow that would make the most efficient use of healthcare resources such as medicines, equipment,…
5 Ways to Boost Your ROI with Salesforce Marketing Cloud
Salesforce Marketing Cloud is a powerful digital marketing platform that enables you to create, manage, and measure personalized customer journeys across multiple channels. With Salesforce…
Popular Salesforce Videos
Business Days in Salesforce CRM Analytics (Tableau CRM)
It's common for businesses to want to take business days into account when showing data on a dashboard in CRM Analytics (formerly Tableau CRM) to…
How To Create A Case Assignment Rule In Salesforce
Learn all about how to create Case Assignment rules. In this video, the following points will be covered - 1. Introduction To Case Assignment Rule…
Powering Dynamic Gamification on Salesforce Communities With ScoreNotch
Gamifying your online community helps you drive highly-engaging user experiences. While you can host your community on Salesforce Experience Cloud, there are limitations with regard…