You need to sign in to do that
Don't have an account?
Visualforce error on 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">
</apex:dataTable>
</apex:form>
</apex:page>
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'
<apex:dataTable value = "{!Products}" var="prod">
Try this
Hi, below is your modified code, try this one
// your Controller
public class ProductsController {
public List <Opportunity>getProducts(){
List <Opportunity> opp;
opp = [Select Name from Opportunity];
return opp;
}
}
//VF Page
<apex:page controller="ProductsController">
<apex:form >
<apex:dataTable value = "{!Products}" var="prod">
</apex:dataTable>
</apex:form>
</apex:page>
Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.