You need to sign in to do that
Don't have an account?
gv007
Unknown property AccountStandardController.account
Error: core.apexpages.el.adapters.exceptions.UnknownPropertyException: Unknown property 'AccountStandardController.account' | |
Error: Unknown property 'AccountStandardController.account'
I have a situation,i want extended some of my standard controller property to my cusom controller ,when using my code i got following,here is my code anybody tell me ,where i did my mistake.
Code: VF page: <apex:page standardController="Account" extensions="myFirstController" showHeader="true" tabStyle="Account"> <apex:pageBlock title="Accounts"> <apex:form > <apex:dataTable value="{!accountList}" var="account" cellpadding="4" border="1"> <apex:column > <apex:commandLink > <apex:outputText value="{!account.name}"/> </apex:commandLink> </apex:column> </apex:dataTable> </apex:form> </apex:pageBlock> <apex:pageBlock title="Contacts"> </apex:pageBlock> </apex:page> Code: public class myFirstController{ public myFirstController(ApexPages.StandardController stdController){ } public Account[] getAccountList() { /* return [select id,name from Account where id = :System.currentPageReference().getParameters().get('id') ]; */ return [select id,name from Account limit 25]; } public String getName() { return 'My First Custom Controller'; } } |
you must use a different value for var, this particular value causes some overloading of the term
{!account.name} is it the standar controller or the dataTable which will fill this in? and thus the error you see
this will work , notice i changed account ==> acc
Ron,
I am working on a Visualforce page to display a list of Accounts and all relevant fields in each object.
Since Apex classes are not supported in SF Group edition, I have no way to create an Controller extension.
How would I make the following code to work? Why wouldn't the standard Account controller return a list of accounts that I can iterate using the dataList tag?
<apex:page standardController="Account" tabStyle="Account">
<apex:dataList value="{!accountList}" var="acc" id="theList">
<apex:outputText value="{!account}"/>
</apex:dataList>
</apex:page>
Andi Giri
@gv007
Were you able to solve the problem then?
I am facing the same problem right now and in need of the solution.
I got it. its working fine nw.
<apex:page controller="ContactsListController" title="Contact List With Custom Controller">
This CustomController is associated with the getter Method. of the specific Object. So the method name of the controller class should be as follows:
-> getContacts
-> Use the correct access specifier for this method for eg.
public static List<Contact> getContacts() {
once you define you controller and the getter method with above specification. You will not face any issue.
Regards,
Rohit
1, the variable what we use to get the list of records from the controller should match the get + rest of method Name.
If getter Method name is
public static List<Contact> getMySpecificContacts() {
Then the variale name you should use is MySpecificContacts
<apex:PageBlockTable value="{! MySpecificContacts}" var="ct">
public static List<Contact> getContacts() {
Then the variale name you should use is MySpecificContacts
<apex:PageBlockTable value="{! Contacts}" var="ct">
we can clearly see here that the variable name matches the getter method name.