Populating multiple lines with HTML formated text via calculated script
Hi I'm with a need of pushing multiple lines, HTML formated text to a Medium HTML field via a calculated script. I tried to use dom constuctor but it didn't work for me well. Eg: Upon selection of an item from one Enume, I want to dispaly some sample text in a readonly "Medium HTML" field. Sample text: [ This is my Tesample text: 1. My first line 2. My Second Line ] Appreciate your help. DK |
Accepted answer
Hi, My progress so far is as follows and I think I found my solution: Sharing this for any intersted parties awareness- Sampe code I used: var Request = "* Line 1 \\\\\ **line 2** \\\\\ [[The URL2|link name1]] \\\\\ --Line 3-- \\\\\ __New line 4__ \\\\\ [[The URL2|link name2]]"; The output I render to two riffrent fields. One with Wiki and ther other is HTML. HTML output:
wiki Output
So, this can is possible with a wiki field. But still I'm unable to generate a list or a numbered field. If anyone can guide, appreciate your help. DK Ralph Schoon selected this answer as the correct answer
Comments
Ralph Schoon
commented Nov 01 '17, 7:57 a.m.
| edited Nov 01 '17, 8:06 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Note that this answer/post above contains an image that is suppressed because of the missing reputation.
1. I have explained this several times already - and answered in this thread as well in https://jazz.net/forum/questions/245867/populating-multiple-lines-with-html-formated-text-via-calculated-script/245960 . It seems that Java uses the class XMLText.createFromPlainText() to encode the JavaScript value for HTML strings and the description, which has the effect described.
2. Wiki attributes don't do this. See http://www.wikicreole.org/ for the Wiki syntax.
Dulsanka Kulasinghe
commented Nov 01 '17, 10:03 a.m.
Thanks Ralph |
3 other answers
Ralph Schoon (63.5k●3●36●46)
| answered Oct 20 '17, 8:27 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER edited Oct 23 '17, 4:13 a.m. Since you only provide the absolute minimum of information and were not even able or willing to answer Don's question (See How should I ask a question in the Forum if I want to receive useful answers? if you want to improve yourself), here my suggestion:
|
Hi Ralph First, I did ask the question with maximum possible way I can ask same and even with an example. Really sorry for you not being able to understand what I want. Second, again really sorry as "What didn't work? Did the text not appear in the field?" for me, this is more an unclear question. I assumed that he is asking about using "Dom", so I mentioned the actual error I got, The "Dom Constructor" was not recognised at the execution. Assuming it is not clear, let me try to repharese the question. I use a customised attribute linked to an enumeration (Let’s say its "Country") What I want is, to display some bullet point statement about the selected country in another custom attribute field (let’s say "Country Description"). Eg: when I select "USA" in the country field, I want to display like below in the "Country Description" fielf. 1. USA has XX states 2. Its boarded to XXX, XXXXX, XXX countries. 3. The capital of USA is XXXXXXXX I would like to know, can this be done via a Calculated script or is there any easy way of doing this? Thanks DK Comments See my answer: above: https://jazz.net/forum/questions/245867/populating-multiple-lines-with-html-formated-text-via-calculated-script/245960 I made the relevant part more obvious.
|
I've found that using the br tag for each line works in HTML fields.
Comments
Dulsanka Kulasinghe
commented Nov 01 '17, 4:29 a.m.
Hi - This Didn't work. What did you see?
The browser didn't recognise any of above tags. Hence, the output was as same as the code text.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
What didn't work? Did the text not appear in the field? Or it appeared but in a wrong format?
If you ask about dom constuctor, it never recognised; so no output.
Is it possible to direct me to an examle or share with me an examle code for this?
https://jazz.net/library/article/1093
Thanks Ralph for sharing, however, yet I'm in doubt what to refer?
Will I get a way to return a multiple lined HTML text (as in the example) to a mediumHTML in the article you shared? Based on my reading I'm bit confused with the answer.