This line is used in a label computed value in an xpage. I would like to cast the returned value to a RichTextItem, however the javascript entry screen for the computed value specifies the error in front of the line under the red cross:
Encountered “doc” at line 3, column 28. Was expecting one of: “in”…, “==”…, etc.
The line of code it deals about is:
var rtitem = (RichTextItem)doc.getFirstItem(“TicketRemarks”);
For the good sake of order, the selected language for the computed value is JavaScript(Server Side).
Could anyone help me what is wrong about the casting.
I was trying to get HTML markup stored in a Rich Text field but had the same problem. I can’t find a way to return the correct data type either. The code in help not only produces an error in the Designer editor but fails on the server as well.
I wound up adding a field on the form called ‘HTML’. This special field name works for this purpose. You might consider doing the same and have it be calculated on the form from your source Rich Text field.
the purpose of the cast is for getting a rich text object and from here I create the unformatted text version of the rich text item. Actually I want to strip all tags which are influencing the display style.
I also tried the example code in the help file for getFirstItem and is listed below.