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

Visualforce Unknown property error on Opportunity Custom Controller

Can someone please help me wtih this error message on the following Custom Controller:



Save error: Uknown property 'ProductsController.opp'


Here is the custom controller:


public class ProductsController {

public List <Opportunity>getProducts(){

List <Opportunity> opp;

opp = [Select Name from Opportunity];

return opp;





Here is the Visualforce page:

<apex:page controller="ProductsController">

<apex:form >
<apex:dataTable value = "{!opp}" var="prod">




I am not sure why it is telling me that the opp variable used in the List of my custom controller is an unknown property.


Error Message: Save error: Unknown property: 'ProductsController.opp'



Your method is called getProducts, so the expression to access it would be {!products}.   It has no knowledge of the internal variables used in your code....


Awesome! that fixed it!

thanks a lot aballard