Problem solve Get help with specific problems with your technologies, process and projects.

Generate combobox >64k on Web

Populate fields on a Web form.

To populate a field on a Web form, you call an agent which displays a combobox in a popup-window where you can select a view-entry from a view of unlimited size.
The agent is reusable because you pass him variables for the view to search and the field to populate.
In the given example I use the following elements:
View 'Aufnr'
Field 'Aufnr_'
Agent 'GenerateDialog'

On the form use a button with Javascript: 
var pathname = window.location.pathname);

Then create a LotusScript-Agent (manually from agent list, Run Once):
Sub Initialize
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim view As NotesView
	Dim vc As NotesViewEntryCollection
	Dim entry As NotesViewEntry
	Dim doc As NotesDocument
	Dim strVIEW,strFIELD As String
	Dim querystring As String
	Dim Params List As String
	Dim i As Integer
	Set db = session.CurrentDatabase
	Set doc = session.DocumentContext
' pull the query_string from the DocumentContext which represents an instance of this agent
	i = Instr(querystring, "&" )
	Do While i>0
		querystring = Mid(querystring, i+1)
		If i>0 Then 
' Get the Variable Name
			varname = Left(querystring,i-1)
			Exit Do 
		End If
		querystring=Mid(querystring, i+1)
		If i>0 Then 
' Get the Value
			value = Left(querystring, i-1) 
		End If
' Save the Parameter in the list
	Set view = db.GetView(strVIEW)
	Set vc = view.AllEntries
' Generate the HTML-Doc
	Print "Content-Type: text/html" 
	Print "" 
	Print "<HTML><HEAD>"
	Print "<SCRIPT LANGUAGE=""JavaScript"">"
	Print "<!--"
	Print "function CheckSelection() {"
	Print "var frm=window.document._GenerateDialog;"
	Print "for(i=0;i<frm.Sel.length;++i)"
	Print "if(frm.Sel.options[i].selected == true)"
	Print "frmMain."+strFIELD+".value=frm.Sel.options[i].text"
	Print "} // -->"
	Print "</SCRIPT>"
	Print "<TITLE>Bitte wahlen Sie einen Eintrag</TITLE></HEAD>"
	Print "<BODY BGCOLOR=""DAFBFE"" onLoad=""frmMain = window.opener.document.forms[0]"">"
	Print "<FORM METHOD=post NAME=""_GenerateDialog"">"
	Print "<BR>"
	Print "<CENTER>"
' Fill in the Options 	
	Print "<SELECT NAME=""Sel"" onChange=""CheckSelection()"">"
	Print "<OPTION>----- Please select -----<SELECTED>"
	For i = 1 To vc.count
		Set entry=vc.GetNthEntry(i)
		Print "<OPTION>" + Cstr(entry.ColumnValues(1))
	Print "</SELECT><BR>"
	Print "</BODY></FORM></HTML>"
End Sub
This was last published in September 2001

Dig Deeper on Domino Resources - Part 8

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


  • How do I size a UPS unit?

    Your data center UPS sizing needs are dependent on a variety of factors. Develop configurations and determine the estimated UPS ...

  • How to enhance FTP server security

    If you still use FTP servers in your organization, use IP address whitelists, login restrictions and data encryption -- and just ...

  • 3 ways to approach cloud bursting

    With different cloud bursting techniques and tools from Amazon, Zerto, VMware and Oracle, admins can bolster cloud connections ...