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
Connor CainConnor Cain 

display custom class in visualforce

I am trying to create a Custom class to better display a list of multiple objects but when i search for my variables of the Class, the Visualforce throws a code like: "Unknown property 'AccountTestExtension.AccountDataModel.Size' " as well as the Title variable.

Visual Force
<apex:repeat value="{!AccountGroups}" var="AG">
           <tr>
                    <th colspan="{!AG.Size}" scope="row">{!AG.Title}</th>
                    <th colspan="2" scope="row">{!AG.Notes}</th>
           </tr>
           <apex:repeat value="{!AG.Accounts}" var="acc">
                     <tr>
                        <td><apex:outputField value="{!acc.Name}"  style=" height: 40px"/></td>  
                        <td><apex:inputField value="{!Acc.Notes__c}"  style=" height: 40px"/></td>
                        <td><apex:inputField value="{!QAC.Description}"  style=" height: 40px"/></td>
                     </tr>                
            </apex:repeat>
</apex:repeat>
Apex:
public List<AccountDataModel> AccountGroup;

//main code to sort Accounts into different groups and create the different inputs of AccountGroup
//
//

public with Sharing Class AccountDataModel{
        public String Title;
        public Integer Size;
        public String Notes;
        Public List<Account> Accounts;
        public QADataModel(String title, Integer sze, String note,List<Accounts> Acc){
            this.Title = title;
            this.Size = sze;
            this.Notes = note;
            this.Accounts = acc;
        }
        
    }


 
Best Answer chosen by Connor Cain
David Zhu 🔥David Zhu 🔥
You will have to add getter and setter to the variables.

public String Title {get;set}
public Integer Size {get;set}
public String Notes  {get;set}
and etc.
 

All Answers

David Zhu 🔥David Zhu 🔥
You will have to add getter and setter to the variables.

public String Title {get;set}
public Integer Size {get;set}
public String Notes  {get;set}
and etc.
 
This was selected as the best answer
David Zhu 🔥David Zhu 🔥
and this one
public List<AccountDataModel> AccountGroup {get;set;}
Connor CainConnor Cain
Thank you! that worked