• Piran
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies

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?

  • September 14, 2009
  • Like
  • 0

I posted an idea to JSON tools on VF page but even after previewing correctly, the code in angle brackets got mangled.

 

Can I correct and/or delete the Idea? There seems to be no way.

 

The correct sample of code should look like this:

 

<json: object>
  <json:array name="aList">
    <apex:repeat value="{!myList}" var="v">
      <json:value value="{!v} />
    </apex:repeat>
  </json:array>
  <json:value name="name">{!FirstName} {!LastName}</json:value>
</json: object>

  • September 13, 2009
  • Like
  • 0

I posted an idea to JSON tools on VF page but even after previewing correctly, the code in angle brackets got mangled.

 

Can I correct and/or delete the Idea? There seems to be no way.

 

The correct sample of code should look like this:

 

<json: object>
  <json:array name="aList">
    <apex:repeat value="{!myList}" var="v">
      <json:value value="{!v} />
    </apex:repeat>
  </json:array>
  <json:value name="name">{!FirstName} {!LastName}</json:value>
</json: object>

  • September 13, 2009
  • Like
  • 0