API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Click On Twisty Or Category Title
If you have a Domino view that is being accessed from a web browser, sometimes clicking on the twisty can be not very intuitive, especially for a non-Notes user. There are many ways to "spruce up" the view, but most of these require a good amount of HTML coding or JavaScript coding. What if you just want something quick?

When we heard about one company charging money for this solution, we were appalled. There is a correct place and time to charge for something, but this is certainly not one of them. Our solution is so simple to implement, that charging money for it would be a crime.

Go into the categorized column in your view. Add a string constant before and after your categorized column formula. The string constant is truly constant, so you don't have to worry about the order of your categories changing. The string to add before your current column formula is:

"[<script language=\"JavaScript\">document.write(\"<a href=\'\" + document.links[document.links.length-1].href + \"\'>\"); </script>]"

The string to add after your current column formula is:

"[<script language=\"JavaScript\">document.write(\"</a>\"); </script>]"

So, if the categorized column value is coming from a field on the document called Category, here is your formula:

"[<script language=\"JavaScript\">document.write(\"<a href=\'\" + document.links[document.links.length-1].href + \"\'>\"); </script>]" + Category + "[<script language=\"JavaScript\">document.write(\"</a>\"); </script>]"

What's going on here?

Well, while the view is being generated, the browser is being told to write out the string "<a href=" followed by whatever the last link is. That last link is always going to be the link that was just generated by Domino around the twisty that appears at the start of the categorized column. After that, the browser is told to write ">". That closes out the <a> tag. Then Domino writes out the categorized column value. Then we need to close out the <a> tag around the value. That is done with another JavaScript "document.write", but could just as easily be done using straight HTML: "[</a>]".