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
OxeneOxene 

Calling apex method with parameter from Visualforce page

Hi all,

Can anyone tell me how i can call a apex class method with parameter from a visualforce page?

This is my code.

<apex:outputLabel styleClass="{!relay}" value="Postal Code"/>

How can i pass a value to the apex method 'relay' as shown above?
Best Answer chosen by Admin (Salesforce Developers) 
OxeneOxene
Thanks for the help. Yes i have a getRelay() method that returns a String. I need the function to have parameters and then return a different string depending on the parameter.

All Answers

mcrosbymcrosby
Do you have a public method in your controller called getRelay() that returns a String?
OxeneOxene
Thanks for the help. Yes i have a getRelay() method that returns a String. I need the function to have parameters and then return a different string depending on the parameter.
This was selected as the best answer
roman cherniaroman chernia

I have the same scenario: I need to call a method with parameter.

Does anybody know how to do that?

Thanks.