-
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
Understand Separation of Concerns Unit | Salesforce Developer Guide
Presentation Programming, similar to hairdos, is regularly alluded to as something living that changes and advances over the long run. From the single-celled one-celled critter…
Chrome Extensions for Salesforce - A comprehensive review
Evgeny Azimzhanov works on the team at Aquiva Labs. They build customer-centric cloud apps on several platforms - especially Salesforce. Evgeny shares his experience trying…
Popular Salesforce Videos
Salesforce Vaccine Management | Salesforce Vaccine Cloud
Leveraging technology to manage vaccines has become increasingly important. Salesforce is investing in the public sector to aid the efforts to combat the spread of…
Salesforce Marketing Cloud Connect
We explore the key benefits of Marketing Cloud Connect as the start of a four-part series surveying the power, flexibility, and personalization that can be…
Salesforce Development Course for Intermediate Developers
If you want to become a Salesforce developer in 2021 then watch this video, here you'll learn about some of the best Salesforce Development Course…