Tech Tip: Dialog buttons in Notes 6.x
Category Technical
Bookmark :
There are many new features around buttons, specifically buttons you would use in dialog boxes, in Notes 6. You now have the ability to specify a "default behavior" for a button. There are various choices available, such as OK, Cancel, Help, and Normal (which is the way "old" buttons work). You can read more about it in the Designer help, but for now let's concentrate on the OK and Cancel buttons, and a little anomaly I found when using them. First, a little background...
An "OK" type button will basically perform the steps of a RefreshParentNote (@Command or NotesUIWorkspace method) and a FileCloseWindow. You simply enable the button as an OK type button, place any extra code you want into the button, and then that's it. The "Cancel" type button is similar - you don't have to enter anything, it simply closes the dialog without refreshing the parent note. So far, so good. The problem arises if you start playing with these features to determine if they work in your situation, and you mark your OK button as "Normal" but leave your Cancel button as a Cancel button type. Then, strange things happen. If you place an @Command([FileCloseWindow]) into your "normal" OK button while the Cancel button is a "Cancel" type, then you will get TWO close window actions - effectively closing you out of where you came. If you remove the @Command[FileCloseWindow]) from your "Normal" OK button, it doesn't close the window at all when pressed. Oh, and if you move the close action out to an agent, it STILL closes it twice if you have the Cancel button marked as type "Cancel" while the OK button is marked "Normal".
So, the moral of the story is that the new "button type" feature is an all-or-nothing proposition: either use it for all the buttons in your dialog box, or don't use it at all.
Hopefully this wasn't too confusing - if I need to clarify it, please speak up.
Rock
**Why do we say something is out of whack? What is a whack?







Blog Roll









Comments
Stay tuned...
Rock
Posted by Rock At 07:45:42 AM On 06/01/2004 | - Website - |
I use your "Teach Yourself LotusScript" at least once a week for the last 2 years or so.
Thanks for being there....
Posted by Jay Fulton At 03:26:39 PM On 02/10/2006 | - Website - |
Way off the subject of dialog box buttons, I was wondering if I could piggyback on your immense knowledge of Lotus Notes Development. Without giving away any of your trade secrets, can you tell me how you manage the development of the Lotus Notes Applications you build? I am starting to manage larger projects than I ever have before and thus having a harder time managing them. Any help from the
famousinfamous Lotus Geek would be greatly appreciated!Thanks,
Ryan
Posted by Ryan Jackson At 06:25:38 PM On 05/26/2004 | - Website - |