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
Ima_BweaverIma_Bweaver 

Unknown Property 'accont' referenced in Visualforce Page

I have an error within Visualforce Page that uses a Custom Controller. The Class compiles correctly, but the Visualforce Page seems to not recognize the name of the custom controller program that I am calling. I've tried looking at others that had the same issue but there the code that fixes the problem follows the same format of the code I am using to call the function. Help please!

The error specifically states "Unknown property 'accont' referenced in Radio_Button_app_Example.

Here is the code for the visualforce page that is giving the error
 
<apex:page >
    <apex:form>
        <apex:pageBlock>
        	<table>
               <tbody>
               	  <tr style="display:table-row;">
                	 <th style="width:10%;">Select Account</th>
                     <th style="width:10%;">Name</th>
                     <th style="width:10%;">Account Number</th>
                     <th style="width:10%;">Annual Revenue</th>
                     <th style="width:10%;">Number Of Empoloyees</th>
               	  </tr>
                  <apex:repeat value="{!accont}" var="acc">
                   		<tr>
                            <input value="{!acc.Id}" Name="SelectedAccount" Type="radio"/><br/>
                            <apex:outputText>{!acc.Name}</apex:outputText>
                      	</tr>
                  </apex:repeat>
               </tbody>
            </table>
        </apex:pageBlock>
    </apex:form>
</apex:page>

and here is the controller that is having no issues saving
 
public class cRadio_Button_app_Example 
{
    public List<Account> accont {get;set;}
    
    public cRadio_Button_app_Example () 
    {
       accont=NEW List<Account>([SELECT Id,name,AccountNumber,AnnualRevenue,NumberOfEmployees FROM Account]);
    }
}


Any help on this would be greatly appreciated!​​​​​​​


Thanks,
​​​​​​​Brandon Weaver

Best Answer chosen by Ima_Bweaver
Ima_BweaverIma_Bweaver
Figured out the issue!

I never actually cited the Controller reference in the first line. 

Here is the version of the code that works. Notice the difference in the first line
 
<apex:page controller="cRadio_Button_app_Example" >
    <apex:form>
        <apex:pageBlock>
            <table>
               <tbody>
                  <tr style="display:table-row;">
                     <th style="width:10%;">Select Account</th>
                     <th style="width:10%;">Name</th>
                     <th style="width:10%;">Account Number</th>
                     <th style="width:10%;">Annual Revenue</th>
                     <th style="width:10%;">Number Of Empoloyees</th>
                  </tr>
                  <apex:repeat value="{!Accont}" var="acc">
                        <tr>
                            <input value="{!acc.Id}" Name="SelectedAccount" Type="radio"/><br/>
                            <apex:outputText>{!acc.Name}</apex:outputText>
                        </tr>
                  </apex:repeat>
               </tbody>
            </table>
        </apex:pageBlock>
    </apex:form>
</apex:page>