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
ggaopggaop 

How to reference custom controller fields in VisualForce pages...

I need to reference a custom controller extension field in my VisualForce page. How do I do this?

 

This is what I have

 

<apex:page standardController="MyAccount__c" extensions="MyController">
<apex:pageBlock title="Error Messages">
<apex:outputText > {!getMessages} </apex:outputText>
</apex:pageBlock>
</apex:page>

 

 

In MyController class

 

public String getMessages() {

   ...

}

 

I get an error that getMessages is not part of MyAccount__c

 

Thanks, 

 

J

Message Edited by ggaop on 05-04-2009 02:23 PM
Message Edited by ggaop on 05-04-2009 02:25 PM
ShikibuShikibu

So close!

 

remove "get" from the merge field in your VF page.

 

This might be more obvious if you wrote your getter as a property (but the way you wrote it is just fine).