function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mauricio Ramos 16Mauricio Ramos 16 

how do i access a field for a wrapper class in VF

Hello,

I am having trouble showing a wrapper variable in a pageblocktable that iterate over a list of wrapper class objects. The structure is as follow, I have a aLeadRatingResult wrapper class with a list variable of another wrapper class (BusinessInfo). I managed to create the table to iterate over the BusinessInfo list but I keep getting an error when trying to access the variables in it...

controller
public with sharing class LeadRatingResultsView {
        public Lead ld {get;set;}
        public LeadRatingResult leadResults {get;set;}
        public LeadRating_BusinessInfo[] leadBusinessInfo {get{return leadResults.BusinessInfo;}set;}

    public LeadRatingResulstsView(ApexPages.StandardController controller) {
        controller.addFields(new List<String> {'Rating_Result_JSON__c'});
        ld = (lead) controller.getRecord();
        leadResults = (LeadRatingResult)JSON.deserialize(ld.Rating_Result_JSON__c, LeadRatingResult.Class);
    }
}
VF page:
<apex:page standardController="Lead" extensions="LeadRatingResulstsView">
 <apex:detail inlineEdit="true" relatedList="false" />
 <apex:pageBlock >
     <apex:pageBlockTable id="pgblkTbl" value="{!leadBusinessInfo}" var="bi">
         <apex:column headerValue="Id" >
             <apex:outputText  value="{!bi.Id}"/>
         </apex:column>
         <apex:column value="{!bi.ABN}" headerValue="ABN" />
         <apex:column value="{!bi.RatingAccuracy}" headerValue="Rating Accuracy" />
     </apex:pageBlockTable>
 </apex:pageBlock>
</apex:page>

ANY IDEAS AS TO WHAT COULD BE CAUSING THE FOLLOWING ERROR MSG: pages/LeadRatingResultsView.page: Unknown property 'LeadRating_BusinessInfo.Id'
Best Answer chosen by Mauricio Ramos 16
Raj VakatiRaj Vakati
Check Id property in LeadRating_BusinessInfo wrapper class is having to get and set and public access specifier.

All Answers

Raj VakatiRaj Vakati
Check Id property in LeadRating_BusinessInfo wrapper class is having to get and set and public access specifier.
This was selected as the best answer
Mauricio Ramos 16Mauricio Ramos 16
thank you, that solved the problem!