« Designing for Section 508 | Main| Show n Tell Friday »

Show n Tell Friday

Okay, I'm a day late, but here's my SnTT for the week, as promised.

A picture named M2
(Again, none of this has to do with reality.)

I showed last week how I was using layers to show embedded elements as floating objects.  Now I've added a capability to my previous treatment to reveal a preview pane of the prior visit by the patient.

UPDATE: Props to my colleague Colin Macdonald for working out the "grab the container UI" stuff you'll see after the jump!
A picture named M2

Hopefully everyone knows how to link an embedded view to an embedded editor, but in case you don't, you just add a view, add an editor, name the editor something like "Preview" and then point the embedded view to open in "Preview" on single/double click.

The thing that makes this interesting is that the trigger is to double-click on the document in the embedded view.  But if you think about it, that's a problem, because you want to have an event firing in the embedded view (QueryOpenDocument) reveal a layer in the containing UI document.  It turns out that this isn't so tough, but fits in with a little known differentiation between NotesUIWorkspace.CurrentDocument and the Source parameter you get on all your various view/form events.  Whether in a regular form, dialog box, or embedded editor, "Source" always refers to the firing UIdocument.  BUT, NotesUIWorkspace refers to the primary ui document in the current window.  So if you're in a dialog box, it's the underlying document screen that you might have had open when you called the box.  If it's an embedded editor, it's the containing ui document context.  This also goes for views.

So, my embedded view has a simple QueryOpenDocument that includes...

Dim containerUI as NotesUIDocument
Set containerUI = wrkSpc.currentDocument
containerUI.document.tmpBackgroundPreview = "Show"
Call containerUI.refreshHideFormulas
Continue = False

Safety tip: Don't EVER call containerUI.ViewRefreshFields.  It's a nice red box.  (And I'm lying... the event contains a lot more than that, but it's what's necessarily for this demonstration, but you get the point.)

The layer, of course, then reveals itself.

Now, another interesting thing is that the layer anchor itself is actually just below the embedded view.  Normally, that would mean that my window would open way off to the right.  BUT, it turns out that layer positioning in the Notes clients respects negative offsets.  So in this case, I set my Left offset to -158 Percent, and the whole thing shifts nicely off to the left.  If you choose to try this technique, adjust until it looks right to you.  If you specify the embedded editor as the proper form, you'll be able to do this fairly easily in designer.

You might note that my preview window itself has embedded views.  Wheels within wheels, huh?

Comments

1 - Hi Nathan,
Nice article. Can you please explain how did you hide the layers and where did you write the code to hide/unhide the layers.

Thanks
Ram

2 - This and your previous article made my mouth drop - I had to make sure you were actually using the Notes Client. This is the best work I've seen in a Notes UI. I'll be getting my team to look at the UI in a new light now!
Cheers
D:)

3 - This is a bit of a wish list for some improved Notes Client UI capabilities. What I woud like to see in notes views is the ability to trap the event of selecting a document. I dont want to force my users to double click a document in an embedded view just to be able to run some code on that event. And the other thing about views is the ability to customise the look of a selected row such that the background and font colour can be specified. In embedded views the selected document is not so obvious when the embedded view has lost focus.

Of course, like the previous show-and-tell this is up there.

Post A Comment

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

Search 

Disclaimer 

Welcome to Escape Velocity!

Opinions expressed here by Nathan T. Freeman are not necessarily those of his employer. However, there's a decent chance they are, so check with them if you really want to know.

But really... do you need that kind of validation? Are the opinions expressed here in doubt?

MiscLinks