I’ve got a dialogbox that is called from LotusScript. This dialogbox is based on a form that has it’s own custom OK/Cancel buttons. The ws.DialogBox call is:
intResponse = ws.DialogBox(“TrAcq”, True, True, True, False, False, False, “Edit Acquisition/Easement Document”, docDialog, True, True, False)
Both the [noCancel] and [noOkCancel] parameters are set to true. The custom OK/Cancel buttons do some stuff on the form (like validate some fields and refresh the parent note). These button work great. The problem I’ve encountered is: What if the user presses the “Enter” button on the keyboard? If the cursor is in a text field, this will place a new line in the field, but if the cursor is in one of the NativeOS number fields, the dialogbox is “submitted” (it is closed and the parent note is refreshed without any of my custom OK button code running). If they press “Esc,” it’s not that big of a deal, as my custom Cancel button just closes the window anyway.
It makes sense to me that Notes would have no idea that the code in my custom button should be run, but there has got to be a way to execute some custom code if the user presses the “Enter” button on the keyboard??? Otherwise, the ability to create your own OK/Cancel buttons seems somewhat less valuable.
Subject: Dialogbox and Custom OK/Cancel buttons don’t work with Enter/Esc Keys
It is less valuable. The no button options are not necessarily there so that you can replace the standard buttons with your own. You can dialog a lot more than the fields of the current document, so OK and/or Cancel buttons are not necessarily appropriate in all circumstances. If you pop up a picture of a document’s creator from a different database, would OK or Cancel be better for closing the picture?
Subject: Dialogbox and Custom OK/Cancel buttons don’t work with Enter/Esc Keys
DOH! How come it’s always just after I post a question here that I come across the answer. I’m such a dumb*ss. I won’t tell you how long I’ve been trying to solve this problem for. Seems like whenever you can’t find anything about a problem on the Domino Forums, it’s either because your problem is so freakish and particular that no one’s ever seen it before, or it’s because the solution is so obvious no one can believe you’re asking the question.
From the Domino Designer Help on Creating A Button (this is part of the Properties Infobox for a button):
Type of button
Description
Default
Check this box for the hotspot button you want to become the default button for the template dialog box. If the user presses Enter when the focus is not on a button, this is the default button that is pressed instead. Note that a dialog box can have only one default button.