I have 2 objects, contacts(parent) and custom_1(child). Im pulling info from both objects and need to display it in a VF table. So in the controller I have the following query
You don't have to use another pageBlocktable. You could use an apex:repeat tag instead. But you have to iterate over the subquery since there can be more than one record in the subquery.
You don't have to use another pageBlocktable. You could use an apex:repeat tag instead. But you have to iterate over the subquery since there can be more than one record in the subquery.
Could you please explain how to show both query and subquery records in a single pageblock table, I don't want to use nested tables i want show all in a single table.
Suppose if i use repeat means it will show every record in one table, How to avoid
You need to do a nested table inside of your table.
For the last column do this instead.
<apex:column>
<apex:pageBlockTable value="{!selecCont.Custom_1__r}" var="custom">
<apex:column value="{!custom.Addres__c}"/>
</apex:pageBlockTable>
</apex:column>
You don't have to use another pageBlocktable. You could use an apex:repeat tag instead. But you have to iterate over the subquery since there can be more than one record in the subquery.
All Answers
You need to do a nested table inside of your table.
For the last column do this instead.
<apex:column>
<apex:pageBlockTable value="{!selecCont.Custom_1__r}" var="custom">
<apex:column value="{!custom.Addres__c}"/>
</apex:pageBlockTable>
</apex:column>
You don't have to use another pageBlocktable. You could use an apex:repeat tag instead. But you have to iterate over the subquery since there can be more than one record in the subquery.
It worked, thanks so much!
been banging my head against this wall for a while now.
Hi Andrew,
Could you please explain how to show both query and subquery records in a single pageblock table, I don't want to use nested tables i want show all in a single table.
Suppose if i use repeat means it will show every record in one table, How to avoid
Is It possible to Show all in one place.