0

When I am trying to reference each of the list values within RowData I get an "Unknown Proprtty" error. When I remove the inner repeat below the table renders with the values that are not in the List: AccountNumber and Custodian, so the first.RowData needs to change otherwise it breaks. The problem I am having is how to reference RowData. I have tried using ...text value "= {!secondRepeat.RowData.FinServ__Price__c}" and ...repeat value="{!dto.RowData}" and a few other variations but I keep coming back to the unknown property. Using the var of the first repeat and .RowData should allow access to the associated values but the output text can has no reference to the wrapper so I am stumped. I have tried it with a getter and setter, but in that case the inner for loop results return null thus returning a null point reference. Please let me know what I am doing wrong.

 <apex:repeat value="{!Tables}" var="firstRepeat">
  <apex:repeat value="{!firstRepeat.RowData}" var="second" >
   <tbody id="tBody">                              
      <tr>      
         <td><apex:outputField value="{!second.FinServ__Price__c}"/></td>
public class DataWrapper {
    public String AccountNumber { get; set; }
    public String Custodian { get; set; }      
    public List<FinServ__FinancialHolding__c> RowData = new List<FinServ__FinancialHolding__c>(); 
} 

public List<DataWrapper> getTables() {

...

List<DataWrapper> TableData = new List<DataWrapper>(); 

{   
  DataWrapper dto = new DataWrapper();
  dto.AccountNumber = 
  row.FinServ__FinancialAccount__r.FinServ__FinancialAccountNumber__c;               
  dto.Custodian = row.FinServ__FinancialAccount__r.Custodian__c;      
  dto.RowData.add(row);
 }
 TableData.add(dto);
}
2
  • is this a typo? <apex:repeat value="{!Table}" var="firstRepeat">? shouldn't it be <apex:repeat value="{!Table}" var="first"> ?
    – cropredy
    Commented Dec 28, 2023 at 0:09
  • @cropredy Sorry had not copied it over properly. I had "firstRepeat" in the inner repeat and was getting the "Error: Unknown property" message. Commented Dec 28, 2023 at 14:15

1 Answer 1

0

I am not able to explain the technical aspects of it, but for others with a similar problem can hopefully use this. In my DataWrapper I had to change the RowData list of lists to a property

public List<FinServ__FinancialHolding__c> RowData  { get; set; }

then create a constructor within the wrapper

public DataWrapper(){
            RowData = new List<FinServ__FinancialHolding__c>();
        }

and within my method I also needed to add

DataWrapper dto = new DataWrapper();
                    
if(dto.RowData == null) {
   dto.RowData = new List<FinServ__FinancialHolding__c>();
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .