Thursday, May 22, 2008

How to Insert HTML into a Webtop component using a label

Below I will show you how to output plain text or HTML to your custom component. Thats right! You can output HTML to the component screen from the class using the Label tag!
Documentum outputs dynamic text and controls to Webtop Components via custom JSP tags.

Example outputting plain text to the component screen

JSP file:
<dmf:label name="documentumMessage"  />
Class file:
Label msg1 = (Label) getControl("documentumMessage",Label.class);
msg1.setLabel("documentum is crazy");


Example outputting html to the component screen:

JSP file:
<dmf:label name="documentumMessageWithHtml" encodelabel="false"/>
Class file:
Label msg2 = (Label) getControl("documentumMessageWithHtml",Label.class);
msg2.setLabel("<strong>documentum is <em>crazy</em></strong><br />");

If you do not set encodelabel="false", the HTML will be printed to the screen instead of rendered. (Do not try and set this attribute from the Class file because it will not work.)


Output

No comments: