-
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
A Guide for Salesforce Certification
In today's world, Salesforce is a huge platform for all the developers, admins and consultants as well as for customers also. So Salesforce provides their different…
Advancing the Salesforce's Email-to-Case with Email to Case Advance
Intensifying Subscription Economy & Retaining Customers I am not going to go back to the books to explain what ‘Subscription Economy’ is. We all are…
Salesforce Email Studio – Top compelling reasons why you need it
Salesforce Email Studio is among Salesforce’s Marketing Cloud tools designed to deliver the right message to the right audience at the right time, run email marketing…
Popular Salesforce Videos
Top 5 Features Salesforce Winter Release '21
Even though we're in the middle of one of the strangest summers in our lives, we can rely on one constant: releases from Salesforce. It's…
Lightning Roadmap for Salesforce Developers: Components, Services and Tools
Whether you're a Visualforce developer just learning about Salesforce Lightning or a JavaScript guru who eats new UI frameworks for lunch, this session is for you!
Access Salesforce Maps Schedule and Manage Saved Events
Watch this video to learn how to Access Salesforce Maps Schedule and Review and Manage Saved Events. Do let us know in the comment section…