You need to sign in to do that
Don't have an account?
Mohammadasif Siddiqui
I am not getting column name
<apex:page controller="sample1"> <apex:pageBlock > <apex:pageBlockSection columns="1" > <apex:pageBlockTable value="{!acct}" var="a" > <apex:column headerValue="Action"> <apex:outputLink value="{!URLFOR($Action.Hospital__c.Edit, a.Id)}">Edit</apex:outputLink> </apex:column> <apex:column value="{!a.Name}" /> <apex:repeat value="{!a.Account__r}" var="c" > <apex:column headerValue="Account Name" value="{!c.Name}"></apex:column> </apex:repeat> </apex:pageBlockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:page>
public class sample1 { public List<Hospital__c> acct {get;set;} public sample1() { acct = [SELECT Name, Account__r.Name FROM Hospital__c]; } }
I am not getting the header name "Account Name" like Hospital Name
I have declared headerValue also in Line 12 also
Please try <apex:column headervalue="{!a.name}"> or <apex:column headervalue="{!c.name}">
If that doesn't work you can try using apex:facet. Below is the sample code
Also found this blog post describing the same issue that might be helpful
https://www.sfdcstuff.com/2014/11/headervalue-not-displayed-in-apex.html
Anudeep