-
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 Essential to Setup When you are Implementing Salesforce Pardot for the First Time?
Pardot is a solution for B2B Marketing Automation and comes with powerful tools to generate more leads to enable your sales team to close more…
SSO Implementation between two Salesforce Orgs in Lightning and Classic view
We can implement SSO for both Lighting and Classic view with the help of SAML. There is no difference between security protocol for both. Requirement:…
Provide the right solution | Salesforce & Tableau Integration
Imagine having an advantage that lets you understand your customers better than ever before. That's exactly what happens when you combine the might of Salesforce…
Popular Salesforce Videos
Salesforce Admin Mock Interview Questions and Answers
In this Salesforce Mock Interview Series, I'm dropping the seventh podcast/video of the Salesforce Admin Mock Interview Questions and Answers. This will help you to…
Extend your Reporting Strategy with AppExchange | Reports & Dashboards | Salesforce
This Salesforce Tutorial is ideal for both beginners as well as professionals who want to master Salesforce Cloud. Below are the topics covered in this…
Salesforce Integration Crash Course | The Ultimate Guide to Salesforce Integrations
In these 100 minutes, you are going to learn almost all the integration concepts with the help of 2 projects. You will learn about API,…