HTML is appearing as plain Text in quicklink forms

HI Team,
we have recently upgraded to 8.3p4 patch and we could see after upgrade all form text are appearing in plain text. on further checking i figured it i.e contentisescapted needs to be added in form fields. We have creating form based on the rules. find the below as example for the same. is there any way to set contentisEscaped in Rule based forms. i am not able to find a method in java doc like field.setContentIsEscaped(true). Thanks in advance !

Field fieldh1 = new Field();
fieldh1.setDisplayName("");
fieldh1.setName("");
fieldh1.setReadOnly(true);
String sec_source="import sailpoint.tools.Message;import javax.faces.context.FacesContext;Locale browserLocale = FacesContext.getCurrentInstance().getViewRoot().getLocale();";
sec_source += "String notes = sailpoint.tools.Message.localize(\"Note_User_Reenable_WithHelp_Link\").getLocalizedMessage(browserLocale, null);";
sec_source += "String sec_str = \"<font style=\\\"text-align: center\\\" size=\\\"2\\\" color=\\\"red\\\">\" + notes + \"</font>\";\n";
sec_source += "return sec_str;";
Script sec_script = new Script();
sec_script.setLanguage("beanshell");
sec_script.setSource(sec_source);
fieldh1.setScript(sec_script);
fieldh1.setDisplayType("textarea");
sectionHeader.add(fieldh1);

Please assist if someone is having the experienced similar thing.

Hi @kanwantm,

you can it with fieldh1.setAttribute() or adding the html code

<Attributes>
   <Map>
      <entry key="contentIsEscaped" value="true"/>
   </Map>
</Attributes>
2 Likes

I think that is one approach which was suggested by @Emanuele

I was just exploring methods in javadoc and found htmlify(). I haven’t used it but give it a try.

public static java.lang.String htmlify(java.lang.String src)

Take a string that can contain formatting characters typical for hand-edited XML and simplify it for rendering as HTML or within an Ext component.
1 Like

Much appreciated !! This helped in resolving the issue !!

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.