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
Mehiya JetharamMehiya Jetharam 

Problem in Apex:Image Tag

<apex:imagevalue="/img/msg_icons/info32.png" title="High KPI value indicates High Performance score  OR for some KPIs the high value may mean a low performance score.
        Please add Threshold values/score according to KPI"/>

I want to place new line in "title" attribute. I tried \n, &#10;, \t, but nothing is working.
Please help me.
Best Answer chosen by Mehiya Jetharam
MithunPMithunP
Hi Mehiya Jetharam,

You can achieve this in two ways.

1. If you have Apex controller with that page then simply create a string variable and append it to Title attribute.
 
Apex Class:

public string titleValue{get;set;}

//Add below line in your constructor
titleValue = 'High KPI value indicates High Performance score  OR for some KPIs the high value may mean a low performance score. \r\n' + 'Please add Threshold values/score according to KPI';

VF Page:

 <apex:image value="/img/msg_icons/info32.png" title="{!titleValue}"/>

2. You can use Javascript, Please check below link for sample code

http://www.mindfiresolutions.com/Apply-Line-Breaks-In-Help-Text-2461.php

Best Regards,
Mithun.

All Answers

MithunPMithunP
Hi Mehiya Jetharam,

You can achieve this in two ways.

1. If you have Apex controller with that page then simply create a string variable and append it to Title attribute.
 
Apex Class:

public string titleValue{get;set;}

//Add below line in your constructor
titleValue = 'High KPI value indicates High Performance score  OR for some KPIs the high value may mean a low performance score. \r\n' + 'Please add Threshold values/score according to KPI';

VF Page:

 <apex:image value="/img/msg_icons/info32.png" title="{!titleValue}"/>

2. You can use Javascript, Please check below link for sample code

http://www.mindfiresolutions.com/Apply-Line-Breaks-In-Help-Text-2461.php

Best Regards,
Mithun.
This was selected as the best answer
Sameer Tyagi SFDCSameer Tyagi SFDC
Hi Mehiya, 

You can not put HTML things like \n &nbspp; or &#10;  in Title tag. 
Please confirm if you want to show dynamic value in Title attribute.


Sameer Tyagi 
http://mirketa.com/
Mehiya JetharamMehiya Jetharam
Thanks A lot to both of you @MithunP and @Sameer Tyagi For your quick which worked me exactly.

Thanks once again..........