Manage Learn to apply best practices and optimize your operations.

Display rich text field contents without cluttering the view

How do you display all the text entered, in a view without cluttering it?

We sometimes use rich text fields for capturing just plain text information...specifically for Web users who would like to enter their text in a text area rather than in a small text box on their browsers. But then, how do you display all the text entered, in a view without cluttering it?

Put the following code in the HTML Head of your $$View template form having the embedded view

 "<style> td .cel{font-family:arial; font-size:12px; color:#FFFFFF; font-weight:bold; background-color: orange} table .tab{width:100%; height:100%; NOWRAP} #dek {POSITION:absolute;VISIBILITY:hidden;Z-INDEX:200;} </style>"

Put the following code at the top of the $$ViewTemplate form and pass them through HTML:

 <!-- This code is for showing a pop-up layer --> <DIV ID="dek"></DIV> <SCRIPT TYPE="text/javascript"> <!-- Xoffset=10; // modify these values to ... Yoffset= 0; // change the popup position. var old,skn,iex=(document.all),yyy=-550; var ns4=document.layers var ns6=document.getElementById&&!document.all var ie4=document.all if (ns4) skn=document.dek else if (ns6) skn=document.getElementById("dek").style else if (ie4) if(ns4)document.captureEvents(Event.MOUSEMOVE); else{ skn.visibility="visible" skn.display="none" } document.onmousemove=get_mouse; function popup(msg,bak){ var content="<TABLE WIDTH=140 BORDER=1 BORDERCOLOR=orange CELLPADDING=8 CELLSPACING=0 "+ "BGCOLOR="+bak+"><TD ALIGN=center><FONT COLOR=black SIZE=2>"+msg+"</FONT></TD></TABLE>"; yyy=Yoffset; if(ns4){skn.document.write(content);skn.document.close();skn.visibility="visible"} if(ns6){document.getElementById("dek").innerHTML=content;skn.display=''} if(ie4){document.all("dek").innerHTML=content;skn.display=''} } function get_mouse(e){ var x=(ns4||ns6)?e.pageX:event.x+document.body.scrollLeft; skn.left=x+Xoffset; var y=(ns4||ns6)?e.pageY:event.y+document.body.scrollTop;; } function kill(){ yyy=-1000; if(ns4){skn.visibility="hidden";} else if (ns6||ie4) skn.display="none" } //--> </SCRIPT>

Put the following code in the formula of the column you want to show the contents on the richtext field in (assume your richtext field is "MyRichText")

 display := @Abstract([TryFit]; 4000 ; "" ; "MyRichText") link := "[<a href="#" ONMOUSEOVER="popup('<font face=verdana size=1><b>"+ display +"</b></font>','lightyellow')"; ONMOUSEOUT="kill()"><img src="bullet.gif" border="0"></a>]"; @If(display ="";"";link)

Of course, you need to have an image resource called "bullet.gif". Keeping mouse pointer on the image (when users open your view on their browser) makes a layer to popup displaying contents of the richtext field "MyRichText". This way the view is not cluttered with lot of texts and the document need not be opened to read the richtext field contents.

Dig Deeper on Domino Resources - Part 3

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...