Manage Learn to apply best practices and optimize your operations.

Dhtml - Notes View

For those of you that always wanted a Expand/Collapse functionality of a view
on a Browser here is how.
First. This code works with IE4.0 and above, (the Netscape version is under
And with Domino 4.6x
Please follow this steps:
Step 1.
Create view and on the first column place the following code column value event:
"[&LTB>--></DIV>" +
"&LTSPAN CLASS=\'first\' onClick=\'Expand(" + Categories + ")\'>" + Categories +
"</SPAN>&LTBR>" +
"&LTDIV CLASS=\'second\' ID=\'" + Categories + "\'

This column must be categorized.
I'm using the Categories field to categorize my documents, use your own field.
and ...
this code goes on the HEADER of the first column:
[</TH></TR></TABLE><!-- &LTB>]

Step 2.
Create a second column
db := @ReplaceSubstring(@Subset(@DbName; -1); "\\"; "/");
@Text(Date; "D2T1") + " " +
"[&LTB>-->&LTA HREF = \'javascript:openNews(\"/" + db + "/News/" +
@Text(@DocumentUniqueID) + "?OpenDocument\")\' TARGET=\'_self\'>&LTFONT SIZE=1>"
+ Headline + "</FONT></A>&LTBR><!-- &LTB>]"

This column build the contect of the collapsible sections, so you can customize
this as you wish, I'm using my own A HREF because my code is on a frame and I'm
using the _self target.

The selection formula for the view it's your choice, on my example I'm
displaying news documents.

Step 3.
Now you have to create another view, in this case I named the view "News", on
this view include just one column sorted and with the following formula for the
column: @Text(@DocumentUniqueID)

and now the finals steps:
Step 4.
Create the $$ViewTemplateDefault form, or the
$$ViewTemplate for .... form, it's up to you.

Add the $HTMLHead field with the following formula:
"&LTSTYLE>" + @NewLine +
".first {font-family:Verdana; font-weight:bold; font-size:10pt; cursor:hand}"
+ @NewLine +
".second {font-family:Verdana; font-weight:normal; font-size:8pt;
padding-left: 10}" + @NewLine +
"</STYLE>" + @NewLine +
"&LTSCRIPT LANGUAGE=\'JavaScript\'>" + @NewLine +
"<!--" + @NewLine +
"function Expand(secNum) {" + @NewLine +
" if ( == \'none\')" + @NewLine +
" = \'\'" + @NewLine +
" else" + @NewLine +
" = \'none\'" + @NewLine +
"}" + @NewLine +

The @NewLine of the formula sends a Line feed to the browser so you have a much
cleaner HTML code.

The javascript function Expand would do the trick for the Expand/Collapse

I hope this could help !!!
Feel free to contact me for any comments.

Dig Deeper on HTML for Lotus Notes Domino

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 ...