« Better than the original: Launch First Attachment | Main| "Momentum shifts to Notes..." (Computerworld) »

Tech Tip: Dialog buttons in Notes 6.x

QuickImage   
Category
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 


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?

Comments

1 - Ryan, I am out of town (and country) this week, and in Vegas next week, but I would love to talk to you about this more. At first I was going to ask to speak with you privately, but this would actually be a good topic for a blog entry of its own, so I will probably move it to one.

Stay tuned...

Rock

2 - I was working on a dialog box with 2 options and a closewindow, when I found your info. Thanks it's helpful. I'm having fun with @dialog() but there's stuff to learn!

I use your "Teach Yourself LotusScript" at least once a week for the last 2 years or so.
Thanks for being there....

3 - Rocky,

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 famous infamous Lotus Geek would be greatly appreciated!

Thanks,
Ryan

Meet Rocky

Rock - February 2010
Rocky Oliver
If you see me at a conference, please stop me and say hi!

Calendar

Search

Categories

Proudly Employed By

Wofkflow Studios

LOTUS GEEK gear

Social Networking


Add to Technorati Favorites

View Rocky Oliver's profile on LinkedIn

Rocky  Oliver

LotusGeek Blog Roll

Why display a blog roll when Planet Lotus does it so much better?

Dilbert

Buy my book!

Blog Buttons

Atheist - Unitarian - Humanist

Poker Players Alliance