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
studentstudent 

Apex method in visualforce page

Hi!

 

I want to include an apex method, which needs an object as variable, into my own visualforce page. So, if anybody clicks on a commandLink the method should be envoked with the relative object.

 

My approach:

 

<apex:pageBlock title="Title">
<apex:dataTable value="{!method}" var="object" width="100%">
<apex:column >
<apex:facet name="header">ID</apex:facet>
<apex:form >
<apex:commandLink value="{!object.name}" action="{!method(object)}"/>
</apex:form>
</apex:column>
</apex:dataTable>
</apex:pageBlock>

 

 The method [in dataTable value] is defined in an apex class and returns a list of several objects with some attributes, e.g. the name.

The method(object) [in commandLink action] is also defined in an apex class. Unfortunately I can't refer to the object.

 

Does anybody know why?

 

Thanks in advance!

 

Phil 
Best Answer chosen by Admin (Salesforce Developers) 
gm_sfdc_powerdegm_sfdc_powerde
Unfortunately, Visualforce does not support method binding with parameters.

All Answers

gm_sfdc_powerdegm_sfdc_powerde
Unfortunately, Visualforce does not support method binding with parameters.
This was selected as the best answer
studentstudent

unfortunately there is a way to solve this problem ;-)

 

http://community.salesforce.com/sforce/board/message?board.id=Visualforce&thread.id=18815

Ajay111Ajay111
uygyug