You need to sign in to do that
Don't have an account?
Chitra Thambirajan
How to display Rich Text field vallue with line breaks in div
Hi All,
It may be a dump question but am not able to get the answer for this..
My situation is I will be entering some hint values in Rich Text box and need to show(toggle) it to the user based on the click event.
Am entring the values in rich text field line by line.While entering the value am giving enter to make it as line by line.
When am viewing the record with this value is coming properly.
But when am assigning this value to a div tag it is coming as a paragraph instead of line by line.
Why am placing this content to div tag means i need to toggle that rich text content based on the user click.Below is my code,
Any help..
Thanks
Chitra
It may be a dump question but am not able to get the answer for this..
My situation is I will be entering some hint values in Rich Text box and need to show(toggle) it to the user based on the click event.
Am entring the values in rich text field line by line.While entering the value am giving enter to make it as line by line.
When am viewing the record with this value is coming properly.
But when am assigning this value to a div tag it is coming as a paragraph instead of line by line.
Why am placing this content to div tag means i need to toggle that rich text content based on the user click.Below is my code,
<apex:column breakBefore="true" colspan="2" headerValue="Hint" style="border-size:0px;border-color:#fff;" > <div id="{!c.data.Name}" class="hider" style="border-size:0px;border-color:#fff;"> {!c.data.Hint__c} </div> </apex:column>So what change needs to be done to display the rich text data as it is inside of the DIV..
Any help..
Thanks
Chitra
Use below code to solve your problem
Please mark my answer as a best solution to your question to help others if it solves your problem.
All Answers
Same output..Am getting everything in a single line..Not seperated lines...
Use below code to solve your problem
Please mark my answer as a best solution to your question to help others if it solves your problem.
Am getting values properly in line by line with the gelp of your adivce...
Thank you anyway...
Am using the same value in tooltip.
But it is showing with <br> tag..how to change this to line by line ...Any idea..?
I used your code by modifying it and it shows me the expected result. Please check you rich text data you are providing for you records as it seems that you're having <br> in your data,try to use <b/> instead of <b> in your rich-text field data.
How can I escape the HTML tags in apex:coulmn..?
Am just giving enter and giving the next line input...
Also I have noticed the value of rich text field in object,it is added with <br> tag only.
So when am appying this value to the apex:column title property it is simply rendering the value..
The Rich text value when I go for editing,
am not giving <br> tag at the end..
Now it depends on you how to replace those values you can either replace them within your controller before showing on page or you can write a javaScript on page to replace them.
Below is the reference link for similar problem you have.
http://stackoverflow.com/questions/3340802/add-line-break-within-tooltips
Even I tried to hard code the value in title field..It doesn't work,
but it is simply showing line 1
line2 while hover over the apex column...
I have the following function in my apex column's onmousemove event,
and now this alert is,
here ny query is how can I assign this value to the title property of my apex column...?