-
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
Permission Sets in Salesforce - Get Started Guide
Introduction Permission sets are a collection of settings and permissions that allow the users to have additional access, which they have already got from their…
Accessibility in Salesforce - An Overview
What is Accessibility? In practice, accessibility is intended for users with disabilities. Globally, nearly 300 million people have some form of visual impairment and nearly…
Visualforce Pages vs Lightning Components
There are a lot of fundamental differences between Visualforce Page and Lightning Components: Visualforce Page: 1. Page-Centric Model. 2. Most of the processing takes place…
Popular Salesforce Videos
Getting Information from your Salesforce Account for a Salesforce Connection
Watch this video to learn how to get information from your Salesforce Account for a Salesforce Connection. Do let us know in the comment section…
Create Targeted Campaigns w/ Marketing Cloud Advertising | Salesforce Demo
Explore the power of using 1st party data to power ad audiences across the most popular ad channels today, including Google (Search, Shopping, YouTube, Gmail),…
Demystifying OAuth and Connected Apps
Often times, the first thing an application needs to do is authenticate its users. Developers building integrations with Salesforce need a simple and secure way…