With large categorized views, sometimes Web users would like the option of navigating to the last page of a view.
To accomplish this, we used the following steps:
1. Added a hidden field using the CGI variable of 'http_referer' into the $$ViewTemplateDefault
2. Added a hotspot to the template that called an agent.
The agent uses 'count=view.toplevelentrycount' to get the document count on the views. It then uses http_referer in the URL, adds the count minus 20 to redirect the page to the last page.
Initially we tried to use the 'path_info' variable but the 'path_info' would append the 'click' event to the path string.
This works great with non-categorized views too.
Code
Sub Initialize
Dim session As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim count As Long
Dim CurDoc As notesdocument
Dim strPath As String
Set db=session.currentdatabase
Set curDoc = session.DocumentContext
title = curdoc.Title(0) 'used to get view
'because title has spaces and slashes, title is not functional on redirect
strPath = curDoc.http_referer(0) 'used in URL string on redirect
Set view=db.getview(title)
count=view.toplevelentrycount
Print "["+strpath+"&start=" + Cstr(count-20)+" ]"
End Sub