Skip to main content
Hello, 

Is it possible to pass a variable from a hyperlink into a visualforce page? 

For example, if I have a visualforce page with three links to anothe page: 

Red

Green

Blue

Can I have all three of those links point to the same vf page, but the page will render differently depending on which link was clicked? 

So that clicking on the "Red" link would allow me to use an argument like this: 

 

<apex:repeat value="{!listOfObjects}" var="object>

<apex:outputPanel rendered="{!IF(object.Custom_Field_With_Field_Value_Of_Red__c = Variable_Passed_in_by_URL, true, false)}">

Is this remotely possible at all? 

If so how would I do this?  

 
1 answer
  1. Nov 5, 2015, 11:59 PM
    Yes, you can pass that variable to your visualforce page and then use it like this:

    <apex:outputPanel rendered="{!IF(object.Custom_Field_With_Field_Value_Of_Red__c = $CurrentPage.parameters.variable, true, false)}">
0/9000