Question
Quest Diagnostics
US
Last activity: 25 May 2018 16:08 EDT
A string field contains html data with tags. how to display that string as html snippet in UI
Getting the data with html tags from an external application and storing that data in a text field in pega. How to present the data in the html snippet in UI.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 23 Nov 2017 9:25 EST
Pegasystems Inc.
IN
I forgot to tell, in this aswell the formatting will be lost. Do the following for format to be retained:
Add a <pre> tag before the reference. Change the existing RichTextDisplay contol code to:
<pre><pega:reference name='$this-value' mode="literal"/></pre>
Learning
IN
Hello Ashok,
Use Regular Expressions in custom java code to resolve this.
take the stream to a property and use this expression
@String.pxReplaceAllViaRegex(local.RemoveTags,"<(.|\n)*?>",""). This will replace all the tags with a space.
Kindly check the below URL for your reference:-
https://collaborate.pega.com/question/how-remove-html-tags-string-while-displaying-rd
Hope this helps.
Regards,
Hari
Quest Diagnostics
US
Hi Hari,
Thank you for your quick response. I am already using Regex expression to remove but still the customer want it to be displayed as html snippet so that it can be presented in better readable manner. Because if am using reg expression then it is coming as big paragraph, not readable because the data contains date and other information. This data is for notes captured for user actions. So from client getting the formatted data in html into a string filed in pega. So Client suggested to use actual html it is separated by new lines based on the date notes it was it was entered.
Please see the mock up data attached. How to present this as html snippet in Pega from a text filed in UI. Please suggest. thanking you in advance.
Regards,
Ashok
Quest Diagnostics
US
Hello,
Still I am looking for Assistance. Any help in this regard would be appreciated..
Regards,
Ashok
Pegasystems Inc.
IN
Try using the RichTextDisplay control. It will display the content in literal mode
Accepted Solution
Updated: 23 Nov 2017 9:25 EST
Pegasystems Inc.
IN
I forgot to tell, in this aswell the formatting will be lost. Do the following for format to be retained:
Add a <pre> tag before the reference. Change the existing RichTextDisplay contol code to:
<pre><pega:reference name='$this-value' mode="literal"/></pre>
-
Ashok Kumar Kursa
OCBC Bank
SG
thanks Kakul, i was looking for the same... appreciate ur help
Quest Diagnostics
US
Sorry for the delay in response. I was busy with other projects and could not try this. Working perfect.. Thank you very much Kakul.
Pegasystems Inc.
IN
Instead of non-auto generated RIchTextDisplay control, I'd strongly suggest using RichTextEditor control in 'forced' ReadOnly mode.
-
Ashok Kumar Kursa Sainath Kokala