-
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
The Salesforce Marketing Cloud Center of Excellence: How to Govern Multi-Brand Business Units
Modern enterprise organizations face complex challenges when managing digital marketing across diverse portfolios. A single corporation often owns multiple distinct brands that operate in completely…
Salesforce Flow - A Brief Guide You Should Check
In today’s world we all want things to get done in less time, we all want speed. While handling a client, company wants to give…
Salesforce Dynamic Forms: How to Get Started?
Salesforce Dynamic Forms improves the productivity of organizations and provides users only what they require, transforming static data entry into an intuitive experience. Plus, dynamic…
Popular Salesforce Videos
Salesforce Connect ( Cross-Org Adaptor ) | Salesforce Tutorial
This video will talk about external objects using Salesforce Connect, also known as Cross-Org Adaptor. 00:00 Introduction 00:29 Introduction to Cross Org Adapter 01:51 Create…
How Cyntexa Helped Diet Meal And Food Ordering Service Providers Offer Their Users The Ability To Order Online | Salesforce
It is important to keep your business at the top with the latest technical advancements. Presenting you a case study showcasing how Cyntexa Helped Diet…
Simplified Non-Functional Testing for Salesforce Developers
Testing is indispensable to measure, optimize performance, and improve user experience. Watch this video to see how you can measure performance across physical mobile devices…