You need to sign in to do that
Don't have an account?
AkiT
How to build table of records and childs
I have "Tender" object as a child for opportunity. Tender again has versions as a child.
I wanted to create VF section in opp detail page that shows a table of all Tenders and Tenders' versions.
I build a opportunity controller extension that queries the Versions. The query is:
This class at least saves ok. But when I try to create the table in my VF page with following code:
I get save error:
Save error: The class 'java.util.ArrayList' does not have the property 'Name'.
I am not sure how to utilize these fields in VF that I get in Parent - Child SOQL query in my apex controller. Any advice?
I wanted to create VF section in opp detail page that shows a table of all Tenders and Tenders' versions.
I build a opportunity controller extension that queries the Versions. The query is:
Code:
... public List<FL_Tender__c> getTenders() { if(tenders == null) tenders = [select name, (select name, active__c from Versions__r) from FL_Tender__c]; return tenders; } ...
This class at least saves ok. But when I try to create the table in my VF page with following code:
Code:
<apex:page standardController="Opportunity" showHeader="true" tabStyle="Opportunity" extensions="TenderSectionTableController" > <apex:dataTable value="{!Tenders}" var="tender" id="theTable" rowClasses="odd,even" styleClass="tableClass"> <apex:facet name="header">Tenders & Versions</apex:facet> <apex:column> <apex:facet name="header">FL Tender</apex:facet> <apex:outputText value="{!tender.Name}"/> </apex:column> <apex:column> <apex:facet name="header">Version</apex:facet> <apex:outputText value="{!tender.Versions__r.Name}"/> </apex:column> </apex:dataTable> </apex:page>
I get save error:
Save error: The class 'java.util.ArrayList' does not have the property 'Name'.
I am not sure how to utilize these fields in VF that I get in Parent - Child SOQL query in my apex controller. Any advice?
Versions__r is a relatonship name and represents a child relationship and thus a collection of versions. You need to iterate over them just like you are doing with the tender object records.
try this:
same error code appears.
Error: The class 'java.util.ArrayList' does not have the property 'UnitPrice'.
in my case,
this is controller
this is VF page
the red colored paragraph is the problem case.
is there any solution?
thanks.