Manage Learn to apply best practices and optimize your operations.

Jump to the end of a view (web agent)

When displaying a view, it is sometimes useful to have a link to its end.
There is an agent that will redirect you to the bottom of a view...
The way to use it :
<a href='/server/base.nsf/aa_eofView?openAgent&view=viewalias'$gt;Jump to end!</a>
where :
server is the name of your domino server,
base.nsf is the name of the base containing both the view and the agent, aa_eofView is the name of this agent, and viewAlias is the name of your view... PS : getParam and webSyntax are functions used to parse the query string and to format the database file path.
Option Public
Option Declare

Sub Initialize
	On Error Goto errorLabel
	Dim s As New notesSession
	Dim sdoc As notesDocument
	Set sdoc = s.documentContext
	Dim db As notesDatabase
	Set db = s.currentDatabase
	Dim viewName As String
	viewName = getParam ("&view=", sdoc.query_string(0))
	Dim view As notesView
	Set view = db.getView (viewName)
	If view Is Nothing Then		
		Print "Error : view not found<br>"
		Print "<a href='javascript:history.go(-1)'>back</a>"
		Exit Sub
	End If
	Print "[/"+webSyntax(db.filepath)+"/"+viewName+"?
	Exit Sub
	Print "Error : ";Error$(Err);" at line ";Erl
	Print "<a href='javascript:history.go(-1)'>back</a>"
	Resume endLabel
End Sub

Function getParam (keyname, query) As String
	Dim rstr As String
	Dim pos As Integer
	If (Left$(keyname,1)<>"&") Then
		keyname = "&"+keyname
	End If
	pos = Instr(Ucase(query), Ucase(keyname))
	If pos>0 Then
		rstr = Right$(query, Len(query)-pos+1-Len(keyname))		
		pos=Instr(rstr, "&")		
		If pos>0 Then
		End If		
		getParam = rstr
	End If
End Function

Function webSyntax(s) As String
	Dim pos As Integer
	webSyntax = s
	pos = Instr(webSyntax,"")	
	While pos>0
		pos = Instr(webSyntax,"")
	pos = Instr(webSyntax," ")	
	While pos>0
		pos = Instr(webSyntax," ")
End Function

Dig Deeper on Domino Resources - Part 7

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