Sunday 27 July 2014

Query String parameters in Links

You can set query string parameters in links to pages by constructing the link URL manually, or by using <apex:param> tags within the <apex:outputLink> tag.

<apex:outputLink value="http://google.com/search?q={!account.name}">
           Search Google

</apex:outputLink>


                                           OR

<apex:outputLink value="http://google.com/search">
     Search Google
     <apex:param name="q" value="{!account.name}"/>

</apex:outputLink>

my visualforce url would be

/apex/QueryStringInLink?Id=accountId


** We can use apex:param in 
1. apex:outputLink
2. apex:commandLink
3. apex:actionFunction

No comments:

Post a Comment