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
PiranPiran 

Using apex:outputLink when value already has a param, additional param not added correctly

We're calling apex:outputLink from within a component, passing in our Site's current URL (which already contains a parameter). The VF code looks like this:


<p>{!$CurrentPage.URL}</p>
<apex:outputLink value="{!$CurrentPage.URL}" styleClass="entryLink">
<apex:param name="id" value="{!entryId}" />
<apex:outputText value="{!entryTitle}" styleClass="entryTitle" />
</apex:outputLink>

The generated HTML source code looks like this:


<p>http://our-developer-edition.na6.force.com:80/apex/MySite__WebPage?page=Loop</p>
<a href="http://our-developer-edition.na6.force.com:80/apex/MySite__WebPage?page=Loop%3Fid=a0880000005PiWOAA0" class="entryLink"><span class="entryTitle">A Third Entry</span></a>

Surely that's the wrong escaping that's happened inside the href tag of the "&". Shouldn't the output look like this: (I've used bold to show the difference)


<p>http://our-developer-edition.na6.force.com:80/apex/MySite__WebPage?page=Loop</p>
<a href="http://our-developer-edition.na6.force.com:80/apex/MySite__WebPage?page=Loop&amp;id=a0880000005PiWOAA0" class="entryLink"><span class="entryTitle">A Third Entry</span></a>

Is there a quick/safe way round this problem when you don't know if your outputLink's value contains parameters or not?

Dan Blackhall.ax1171Dan Blackhall.ax1171
I have just experienced the same issue.
I have posted a similar question at SFSE: http://salesforce.stackexchange.com/q/14885/80