Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Customization attribute "calculated value"(Scripted base on) for HTML tags

It has set a process for automatic input in the calculated value to the attributes of the HTML type.
HTML Tag from being displayed as it is as a string.
I think there is no way to express in a state of being HTML encoded?

example
[WorkItem View before]

BOLD TITLE

--------------------------------------------
in Script
 GetValue = workitemattribute(attributeId);
        //⇒"
<strong>bold title</strong> "
return GetValue;

--------------------------------------------

[WorkItem View after]


<strong>bold title</strong>   
I think there is no way to avoid?
Please,thanks 

0 votes


Accepted answer

Permanent link
I have not found a way to pass the text data from JavaScript into an HTML attribute without the tag information being escaped out.

From an API perspective, the data in such an attribute is an XML String. You can construct it from plain text, which escapes all tag data or you can create it as XML which leaves the tag data. I haven't found a way to do the latter in JavaScript. I can only do this in Java API.
Ralph Schoon selected this answer as the correct answer

0 votes

Comments

Thanks Ralph
Why
do you use XML?
Does this mean I do not use the "customization attribute"?
Instead, to create an Add-on in the JAVA-API?

I know the Java API and that uses

XMLString.createFromXMLText() to create content for html attributes with html tags in it. I haven't found a way to pass the information in Java Script that conforms to this method.

XMLString.createFromPlainText() to create content for html attributes which results in any html/xml tags being escaped out - like you see in the JavaScript if you just pass a string with tags.


One other answer

Permanent link
The results of the examination of this issue.
The last of the "return value" of the Script, we know is that it enables to some extent by changing.
Use the "decoration string" function of Javascript to value.

For example:
value.bold ();
value.italic ();

Disassemble the Attribute value for each HTMLTags.
"Value (i) <array>" and then consolidated with a Javascript function along to the tag.
For example:
    return value (0) + value (1) .bold () + value (2) .italic ();
view
    str0str1str2

Problem
1. It is an HTML document that has been freely written.
Because there is a need to pack to decompose and sequence for each tag from the beginning, you need to write a recursive processing.

2. failure to create a variable linked to before the return.
For example:
    temp = value (0) + value (1) .bold () + value (2) .italic ();
    return temp;
View
       str0
&lt;b&gt; str1 &lt;/b&gt; &lt;i&gt; str2 &lt;/i&gt;

In particular, "2." We believe that or not is impossible to solve.

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,117

Question asked: Mar 15 '16, 1:01 a.m.

Question was seen: 2,219 times

Last updated: Mar 16 '16, 4:12 a.m.

Confirmation Cancel Confirm