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
Apex_LearnerApex_Learner 

beginner global merge questions

Just starting out in VF, and I'm sure I'm doing something wrong, but I have 2 questions about global merges...

 

1)  The following code:

 

<apex:page >
<apex:outputText value="{!$Label.site.under_construction}"> 
    <apex:param value="MyWebSite" /> 
</apex:outputText>
</apex:page>

 

Renders as follows:

 

<i>MyWebSite</i> is under construction

 

Why are the <i></i> tags not being processed?

 

2)  Adding <script></script> tags seems to fix the problem:

 

<apex:page >

<script></script>
<apex:outputText value="{!$Label.site.under_construction}"> 
    <apex:param value="MyWebSite" /> 
</apex:outputText>
</apex:page>       

 

Renders as expected:

 

MyWebSite is under construction

 

Why do the script tags fix this?  Is the context changing when they are added?

 

I'm using the development mode if that matters... 

bob_buzzardbob_buzzard

Part 1 is expected behaviour - the apex:outputtext component escapes HTML in the rendered value unless you set the escape attribute to false, e.g.

 

<apex:page >
<apex:outputText value="{!$Label.site.under_construction}" escape="false"> 
    <apex:param value="MyWebSite" /> 
</apex:outputText>
</apex:page>

 Part 2 is a surprise to me - I wouldn't expect that to have an impact on the rendering of the text - it looks like a bug to me.