You need to sign in to do that
Don't have an account?
Passing Variables/Parameters to an Apex Class
I posted this in the Apex Class secdtion, but realised it might be better here....I'm hoping this is a simple syntax question.
I'm trying to find a way I can pass a variable from a VF Page to an extensionController. I was expecting it to be something like:
{!myClass(variable)} or {!myClass, variable} but I'm not seeing it referenced anywhere like this.
Basically I'm trying to build a table in my VF page, to show all the KnowledgeArticles we have, I'd like to add 2 columns to display the NormalizedScore of both the Views and the Votes, so I figured I have to write a extensionClass, however because the VF Page is a list of Articles I don't have access to the Id param in the page to build a SOQL off of. I figured I could call something like... <apex:outputText value="{!myClass, article.Id}" /> passing the Id over to myClass and allowing me to find the Vote/View. The context of this line.
the context of that line would be this:
<apex:outputPanel layout="block"> <table> <tr> <th>Article Title</th> <th>Type</th> <th>Ratings</th> <th>Most Viewed</th> </tr> <knowledge:articleList articleVar="article" sortBy="mostViewed" pageSize="100" pageNumber="1" keyword="{!$CurrentPage.parameters.search}" articleTypes="{!$CurrentPage.parameters.types}"> <tr> <td> <a href="{!URLFOR($Action.KnowledgeArticle.View, article.id)}">{!article.title}</a> <p>{!article.summary}</p> </td> <td>{!article.articleTypeLabel}</td> <td><apex:outputText value="{!myClass, article.id}" /></td> <td></td> </tr> </knowledge:articleList> </table> </apex:outputPanel>
thanks for any advice.
J
hi
Hope the below links help:
http://bobbuzzard.blogspot.com/2011/07/passing-parameters-to-apex-method-from.html
HI,
Try this link
http://salesforceworld.blogspot.com/2011/06/parameter-passing-using.html
If a reply to a post answers your question or resolves your problem, please mark it as the solution to the post so that others may benefit.
Chamil's Blog
Thanks I'm gonna give these a try, but both look like they are tied to a button click in order to make it call the controller. I'll attempt to put the Param tag in the OutputText Tag, and see its possible to send the parameter / variable as teh page is loaded.