-
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
Customize and Filter Related Lists in the Salesforce Lightning App Builder
Potentially one of the most significant UI changes coming to Salesforce in the latest Summer ‘22 release is the change to how we work with…
Events in Salesforce Lightning Component
COMPONENT LIGHTNING EVENTS: In Salesforce, the Component Lightning Events are used to interact between the Lightning Components or in other words, we can say that…
Salesforce for Healthcare: Hospitals digitalization with Salesforce CRM
Customer Relationship Management (CRM) in healthcare is highly beneficial as for a hospital chain or a mini-private clinic that provides independent medical practice. Cloud-based healthcare…
Popular Salesforce Videos
Salesforce Apex Rest API Integration
As you know salesforce is an online cloud solution, we might be required to integrate Salesforce with some other third party tool. We have released…
Introduction to Salesforce Shield Platform Encryption | Salesforce Tutorial
Introduction to Salesforce Shield Platform Encryption 0:00 Introduction 1:00 Shield Platform Encryption 2:35 Need for Shield Platform Encryption 3:18 Classic Encryption Vs Shield Platform Encryption…
What is Field Dependency in Salesforce and When to use it?
This video gives a complete knowledge of what Field Dependency is in Salesforce. It's divided this topic into 4 major points that are: 1. What…