-
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
Don’t Neglect these Salesforce Application Development Considerations
Are you a Salesforce user and have the thought of building dynamic apps on the Salesforce platform? If yes, then you have come to the…
Choosing the Top Salesforce Development Company for Your Business
In today’s competitive digital landscape, businesses are continually seeking ways to streamline operations, enhance customer relationships, and drive growth. This is where a reliable Salesforce…
Salesforce Product : Commerce Cloud
Salesforce Product : Commerce Cloud Commerce Cloud is one of the product among other products of Salesforce also plays a key role for making Salesforce…
Popular Salesforce Videos
Salesforce Starter Suite and Pro Suite
Selecting and implementing a new customer relationship management (CRM) software can be daunting for a small business. Luckily, Salesforce offers its Starter and Pro Suites,…
Create Custom Auto Number Field With Your Criteria Using Flows | Salesforce
Have you ever want to have an auto number field but it only populates when certain criteria were met on a record? Now you can…
Salesforce CPQ Subscription Pricing
Configure Price Quote (CPQ) is a powerful sales tool that enables companies to produce accurate and highly configured sales quotes for customers — especially in…