Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In the above statement I used Up & Down arrows symbols directly in Visualforce page.But when moving this code through packages from one sandbox to another sandbox then it is showing as '?' instead of showing ' ▼',' ▲'. Please suggest me anything need to write or any html ASCII codes and how to use them in VF pages..

<apex:PageBlockTable value="{!TrancheNotes}" var="a" rowClasses="odd,even" id="b2"> 
     <apex:column style="vertical-align:top;" > 
          <apex:facet name="header"> 
               <apex:commandLink value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc',' ▼',' ▲' ),'')}" action="{!toggleSort}" > 
                    <apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
               </apex:commandLink>
          </apex:facet> 

most specifically:

value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc',' ▼',' ▲' ),'')}"
share|improve this question
2  
can you share your code? –  Baskaran S Feb 11 at 10:52
    
<apex:PageBlockTable value="{!TrancheNotes}" var="a" rowClasses="odd,even" id="b2"> <apex:column style="vertical-align:top;" > <apex:facet name="header"> <apex:commandLink value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc',' ▼',' ▲' ),'')}" action="{!toggleSort}" > <apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> </apex:commandLink></apex:facet> –  user5257 Feb 11 at 10:58
    
Feel free to update your question with details rather then to comment, that makes it easier to read. I've gone ahead and done it for you this time. –  Samuel De Rycke Feb 11 at 11:05

2 Answers 2

The symbols you are after are the unicode arrows:

▲ = U+25B2 
▼ = U+25BC

In HTML you can use

&#x25B2;

and

&#x25BC;

instead of "pasting" the unicode character straight into your file.

The arrows work (both pasted, and as codes) in my Visualforce test page, the Salesforce Replication Architecture used in Changeset promotion encodes everything to UTF8, which does not support the raw character you can hold in your file, and it is lost in translation.

As there is also a problem setting ASCII codes in the Visualforce attribute value, I would recommend, if you are pushed for time, taking the rendering and logic out of the value and onto the page, with three different combinations of your commandlink set to render at different times using the rendered tag. Sticking this in (or a minor variation thereon) where your single current command link lives, and it should work?

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield=='Opportunity__r.name' && sortDir='desc'}">
Opportunity Name &#x25B2;
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield=='Opportunity__r.name' && sortDir!='desc'}"> 
Opportunity Name &#x25BC;
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>

<apex:commandLink action="{!toggleSort}" rendered="{!sortfield!='Opportunity__r.name'}"> 
Opportunity Name
<apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>
share|improve this answer
    
I would be keen to know if this solved your problem?! –  Simon Lawrence Feb 12 at 16:28

Replace the symbols in the code with their respective HTML entities - which would be &#9650; for the upward triangle and &#9660; for the downward triangle.

<apex:commandLink value="Opportunity Name {!IF(sortfield=='Opportunity__r.name',IF(sortDir='desc','&#9660;',' &#9650;' ),'')}" action="{!toggleSort}" > 
    <apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" /> 
</apex:commandLink>

http://stackoverflow.com/questions/2293081/what-are-the-html-entities-for-up-and-down-triangles


Edit #1

Also, you can move the part responsible for the rendering of the arrows/triangles out of the commandLink's value and place it within the body of the commandLink:

<apex:commandLink value="Opportunity Name "> 
     <apex:outputPanel layout="none" rendered="{!sortfield=='Opportunity__r.name' && sortDir=='desc'}">&#9660;</apex:outputPanel>
     <apex:outputPanel layout="none" rendered="{!sortfield=='Opportunity__r.name' && sortDir!='desc'}">&#9650;</apex:outputPanel>
     <apex:param name="sortField" value="Opportunity__r.name" assignTo="{!sortField}" />
</apex:commandLink>
share|improve this answer
    
Thanks!..It just printing as &#9660..Becoz in quotes('')..No Luck Though :( –  user5257 Feb 11 at 13:46
    
In that case, you can move the part responsible for the rendering of the arrows/triangles out of the commandLink's value and place it within the body of the commandLink. Take a look at Edit #1. –  dino_zg Feb 11 at 16:06
    
Thank You Dino ..It is working Fine..:) –  user5257 Feb 13 at 11:48
    
Glad to hear it :) Cheers –  dino_zg Feb 13 at 13:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.