Execute code when a radio button or checkbox is selected

At times it can be useful to execute some code when a radio button or checkbox is selected.

At times it can be useful to execute some code when a radio button or checkbox is selected. However, in the Notes client there is currently no way to respond to the onClick, onChange, or onSelect event of one of these elements.

To work around this, create a radio button or checkbox field and set it to "Refresh fields on keyword change." Next, in the Postrecalc event of the form (this will require LotusScript) place a check for the currently selected field. This is done using the NotesUIDocument.CurrentField property. When this property contains your field name, execute your code.

The disadvantage is that your code will run whenever the document is refreshed and your radio button/checkbox field has the focus (a workaround can be put in place so that code will not execute if the field had focus the last time it ran).

To use the code below, create two fields, one checkbox named "chkFoo" and one radio button field named "rdoFoo." Set both fields to "Refresh fields on keyword change" and paste the code into the Postrecalc event of the form.


Sub Postrecalc(Source As Notesuidocument)
%REM *****************************************
	Since the Notes client doesn't respect the onClick,
	onChange, or onSelect events of a keyword field this
	function acts as a delegate for controlling these
	events via a document refresh.

	Created by Jordan Matthiesen, GWI Software
%ENDREM **************************************
	Dim strCurField
	
	strCurField = Source.CurrentField
	
	Select Case strCurField
	Case "chkFoo":
		Msgbox "Checkbox checked, item selected: " & Source.FieldGetText( strCurField )
	Case "rdoFoo":
		Msgbox "Radio button checked, item selected: " & Source.FieldGetText( strCurField )
	End Select
End Sub
This was first published in July 2001

Dig deeper on Lotus Notes Domino Administration Tools

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchEnterpriseLinux

SearchDataCenter

SearchExchange

SearchContentManagement

Close