Search

Top Ten List

Of all my ramblings, people seem to find the following the most interesting:
  1. Pimp My Fields
  2. Using the WebBrowser control to view attachments inline
  3. Purty charts in Domino
  4. My approach to DbLookup and DbColumn in Javascript
  5. Mind Map of Database Design
  6. Design Catalog - version control for Domino
  7. Workaround for LotusScript event binding
  8. Clickable URL's in Notes view columns
  9. Every time you use window.open, God kills a kitten
  10. Create, edit, and delete without agents via AJAX

« Pet Peeve | Main| JSFactory »

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:

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

Gravatar Image1 - This tip is great - I had tried using text but didn't want the users to change it, and hadn't got as far as setting Continue to False.

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.

Gravatar Image2 - I've just tried this out and the other problem is that setting Continue to False causes Notes to play the windows 'Asterisk' sound.

This is sooooooo close to what I want it to do.

Gravatar Image3 - Curses... I didn't notice that before, because one of the first things I always do on any new Windows machine is set the sound scheme to "No Sounds" (I just find it so distracting to have everything I do make noise), but I enabled an Asterisk sound and tested again, and you're right: click, DING! So annoying. Does it do that on other "Continueful" events too, I wonder?

Gravatar Image4 - Using a field named "URL" is not a good idea if you want to use the form for web too. Emoticon

Gravatar Image5 - @Ingo, any particular reason? Can't recall encountering any problems with that in the past...

Gravatar Image6 - Using a field named Url with prevent some copy & paste actions in the client (it will paste the content of the Url field instead). That can be quite annoying sometimes.

Gravatar Image7 - And now I remember when this happens. When you try to create doclinks within the client it will paste the content of the Url field instead of a doclink. Sorry for the double post.

Gravatar Image8 - Oops, I was on the wrong track. It's not a web problem but a problem in the Notes client. Sorry.

Thanks Henning.


Gravatar Image9 - @Henning/Ingo, good to know... I hadn't heard that before, but just verified it.

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Contact Me

Hire Me

Elsewhere

What the Quote?

"I'd rather be bitten by another copperhead than go through another finals week."

Matt DeBerard

"Thank you, that's my elbow. It's kinda like a nipple for my arm."

Laura Tripcony

"No, I'm not a whore. I'm a mercenary."

Tim Tripcony

"No, she's all four-cylinder ugly on the inside."

Laura Tripcony

"Or, maybe he's just as passionate about whatever it is he's talking about as I am about robot nausea."

Tim Tripcony

Apparel

Lotus Rocks

I write the code that makes the young girls cry

Current Terror Alert Level

Assorted Linkage

ClustrMap