You need to sign in to do that
Don't have an account?

Display Inner Joing in PageBlockTable
Hello there,
I have a bit of trouble correctly displaying my data:
my apex class:
my visualforce page:
the result:

I am doing almost identical code (class & vf) when I display all contacts from the account related to a task - this works just fine:

Where did I go wrong?
Thanks!
I have a bit of trouble correctly displaying my data:
my apex class:
public class QuoteList { public Opportunity currentOpp {get;set;} public List<Quote> quotes {get;set;} public QuoteList(ApexPages.StandardController stdController) { currentOpp = [SELECT Id FROM Opportunity WHERE ID =: stdController.getID()]; } public PageReference getPdfs() { quotes = [SELECT Id,Name,(SELECT Id,CreatedDate,Name,ContentVersionDocumentId,QuoteId FROM QuoteDocuments)FROM Quote WHERE OpportunityId = :currentOpp.id]; return null; } }
my visualforce page:
<apex:page standardcontroller="Opportunity" extensions="QuoteList" lightningStylesheets="true" action="{!getPdfs}"> <apex:form > <apex:pageBlock > <apex:repeat value="{!quotes}" var="quote"> <apex:pageBlockTable value="{!quote.QuoteDocuments}" var="pdf" > <apex:column headerValue="Name"> <apex:outputlink value="https://meinestadt--syncs.my.salesforce.com/servlet/servlet.FileDownload?file={!pdf.id}" target="_blank">{!pdf.Name}</apex:outputlink> </apex:column> <apex:column value="{!pdf.CreatedDate}"/> </apex:pageBlockTable> </apex:repeat> </apex:pageBlock> </apex:form> </apex:page>
the result:
I am doing almost identical code (class & vf) when I display all contacts from the account related to a task - this works just fine:
Where did I go wrong?
Thanks!
You have put <apex:column headerValue="Name"> inside <apex:pageBlockTable> which is inside <apex:repeat>
This is basically loop inside loop.
Try moving both <apex:column headerValue="Name"> and <apex:column value="{!pdf.CreatedDate}"/> out of <apex:pageBlockTable>.
Hope this helps!
first of all: Love your Name ;)
Regarding your advice I stumbled:
<apex:column> must be the direct child of either <apex:dataTable> or <apex:pageBlockTable>
So what other "type" of table can I use here? And for reference. Here is my code for the task - contact - list:
and the result:
To avoid the repeating of column header,
here's very raw fix, just to have columns once and then regular data from account's contacts-
Setting column headers only once at the beginning of dataTable using basic HTML table tags.
Let me know if this helps!
unfortunetaly this is what it will look like: