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 ?

  • try with \n .... – Ratan Paul Nov 25 '16 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 '16 at 14:11
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>

|improve this answer|||||
-1

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

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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