-
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
Create an Account Records Using Lightning Component
Introduction: A Lightning Component is an UserInterface framework which is used for the development of dynamic web applications which can be used in mobile Phone…
5 Mistakes You Should Avoid While Hiring a Salesforce Implementation Consultant
If you need to start a Salesforce Implementation right from scratch, then you may require a trusted Salesforce Implementation Consultant with the right expertise and experience.…
Popular Salesforce Videos
101 Guide to IBM Watson and Salesforce Einstein
In March 2017, IBM and Salesforce announced a global strategic partnership to seamlessly connect predictive insights found in unstructured data from IBM Watson APIs to…
The Significance Of Salesforce Commerce Cloud and Its Features
Commerce Cloud - an all-in-one unified e-commerce platform pronounced to be amongst the leading commerce solutions of today's time. We are a Salesforce commerce cloud…
Salesforce Admin Interview Questions And Answers For Freshers & Experienced
This Salesforce Admin Interview Questions and Answers video includes all the frequently asked Interview questions that give you an idea to crack your Salesforce Admin…