1

I am trying the following code:

<apex:variable var="variable1"  value="{!CASE(object.field,

                    "val1",  "line1
                              line2",
                    "val2",  "line1
                              line2",
                    "val3",  "line1
                              line2",
                    "")}" />

Can I print line 1 and line2 on separate lines ?

2
  • try with \n ....
    – Ratan Paul
    Nov 25, 2016 at 13:52
  • tried <br/> and \n as well. The text is just printed with the text followed by the tag. Tried escape = "false" as well. It is not supported with apex:variable
    – Afroz Kazi
    Nov 25, 2016 at 14:11

2 Answers 2

1

I have tried with below code and it is working fine

<apex:page standardController="Account"> <apex:form> <apex:variable var="variable1" value="{!CASE(Account.Name, 'val1', 'line1<br/> line2', 'val2', 'line3<br/> line4', 'val3', 'line5<br/> line6', '')}" /> <apex:outputText value="{!variable1}" escape="false"/> </apex:form> </apex:page>

-1

Just use a <br/> where you want the new line.

2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .