SnTT: clickable URL's in a view column... in the Notes client
Category show-n-tell thursday
Bruce just pinged me with a dilemma: he wanted a way to to make URL's clickable when displayed in a view column from within the Notes client. I wracked my brain momentarily, and the only idea I could come up with was using the Inviewedit trick that I first saw Chris Blatnick allude to in his CoolMail demo (explained later in greater detail). This isn't ideal, of course, as that technique requires that you click an icon column - perhaps immediately adjacent to the URL - not the URL itself...
...or does it? One of the parameters included in the Inviewedit event is Continue, something we're typically used to toggling in other events to prevent that event from completing. For example, you might perform some validation in the QuerySave and toggle Continue to False if the validation fails, or toggle it to False in the QueryOpen if you want to load a DialogBox when the user tries to open the document using the standard form. So what happens if Continue is False in the Inviewedit? Even if the column in question is a standard text column (in other words, not displayed as an icon), if Continue is immediately toggled to False, the column never becomes editable! But the event has already been triggered, so you can still determine the row that was clicked (via Source.CaretNoteID), and can therefore get a handle on the document, retrieve the URL, and navigate to it. Voila:
(cross-posted at BleedYellow)
Bruce just pinged me with a dilemma: he wanted a way to to make URL's clickable when displayed in a view column from within the Notes client. I wracked my brain momentarily, and the only idea I could come up with was using the Inviewedit trick that I first saw Chris Blatnick allude to in his CoolMail demo (explained later in greater detail). This isn't ideal, of course, as that technique requires that you click an icon column - perhaps immediately adjacent to the URL - not the URL itself...
...or does it? One of the parameters included in the Inviewedit event is Continue, something we're typically used to toggling in other events to prevent that event from completing. For example, you might perform some validation in the QuerySave and toggle Continue to False if the validation fails, or toggle it to False in the QueryOpen if you want to load a DialogBox when the user tries to open the document using the standard form. So what happens if Continue is False in the Inviewedit? Even if the column in question is a standard text column (in other words, not displayed as an icon), if Continue is immediately toggled to False, the column never becomes editable! But the event has already been triggered, so you can still determine the row that was clicked (via Source.CaretNoteID), and can therefore get a handle on the document, retrieve the URL, and navigate to it. Voila:
Let Continue = False
Dim workspace As New NotesUIWorkspace
Dim session As New NotesSession
Dim dbCurrent As NotesDatabase
Dim docSelected As NotesDocument
Set dbCurrent = session.CurrentDatabase
Set docSelected = dbCurrent.GetDocumentByID(Source.CaretNoteID)
Call workspace.URLOpen(docSelected.GetItemValue("URL")(0))
(cross-posted at BleedYellow)








Comments
The biggest problem I have is that (in Notes 7 at least - haven't tried it in 8) the user often has to click twice on the row to get the event to fire - once to move the caret to the target document, then again to fire the event.
Posted by Michelle O'Rorke At 01:15:51 On 06/19/2008 | - Website - |
This is sooooooo close to what I want it to do.
Posted by Michelle O'Rorke At 01:26:47 On 06/19/2008 | - Website - |
Posted by Tim Tripcony At 02:22:08 On 06/19/2008 | - Website - |
Posted by Ingo Spichal At 03:04:09 On 06/19/2008 | - Website - |
Posted by Tim Tripcony At 03:19:18 On 06/19/2008 | - Website - |
Posted by Henning Heinz At 03:35:10 On 06/19/2008 | - Website - |
Posted by Henning Heinz At 03:40:37 On 06/19/2008 | - Website - |
Thanks Henning.
Posted by Ingo Spichal At 04:06:15 On 06/19/2008 | - Website - |
Posted by Tim Tripcony At 10:51:12 On 06/19/2008 | - Website - |