SnTT: Embedded Picklist

by Thomas Bahn,
assono GmbH, Standort Kiel,


Sometimes you want your users let choose from a very long list of options. Typically these options are stored as separate Notes documents and could be sorted in different ways. For example: product documents, which could be sorted by hierarchy, by category, name or number.

Usual approaches for this task are:

  1. Action, which uses @Picklist and stores the result in a field,
  2. own dialog box, which uses a self-made (sub-)form,
  3. some dialog lists, where the options of "lower" ones depend on selections in the "upper" ones
  4. or simply a very loooong listbox or dialog list.

I want to show you another way, which
leverages an embedded view and an embedded editor. I think, this solution
has following benefits.

 

  • The context is not changed (other than using @Picklist or dialog box)
  • The view can be sorted by the user dynamically for the different criterias (other than dialog list cascade or single listbox/dialog list)
  • The view could be structured using alternating background colors


Here is a practical example of a acquisition document (cutout) in the Notes client:

A picture named M2

The user can select the result of an acquisition, then the product and finally create a sub-document using the "Add result" action.
To choose the product, he can sort the embedded view and use the Quicksearch feature to find the product in question.

In the design of the form, there are two main elements for this functionality: the embedded products view and the embedded editor (highlighted by the red border):

A picture named M3

The embedded view contains another hidden column with the product id:

A picture named M4

And the target for single and double clicks is the embedded editor:

A picture named M5

Therefore it is important, the embedded editor has its name set (SelectedProduct). And the editor is hidden!

A picture named M6

As far as this point, a normal combination of embedded view and editor - besides the editor is hidden. What's still missing is the "trick", the connection back to the calling form (the container). This is implemented in the PostOpen event of the product form:


Sub Postopen(Source As Notesuidocument)
        Dim containerDoc As NotesDocument
        Dim thisDoc As NotesDocument

        Set containerDoc = uiws.CurrentDocument.Document
        Set thisDoc = source.Document

        ' is doc displayed in an embedded editor?
        If containerDoc.UniversalID <> thisDoc.UniversalID Then
                containerDoc.ProductIInput = thisDoc.ProductID
                containerDoc.ProductNameInput = thisDoc.ProductName
                containerDoc.HierarchicalProductNameInput = thisDoc.HierarchicalProductName
        End If
End Sub

This LotusScript was converted to
HTML using the ls2html routine,
provided
by Julian Robichaux at nsftools.com.



The If statement checks, if the document
if opened in an embedded editor. In this case, containerDoc contains the
Notes document of the container and thisDoc the product Notes document.
Therefore the Then block copies some information from the product document
to the acquisition document!


That's it!


I was inspired by the following blog
entry on Chris Blatnick's Blog: Lotusphere
Demo: Enhancing A Template UI
Technical article IBM Notes IBM Notes Traveler Development

Sie haben Fragen zu diesem Artikel? Kontaktieren Sie uns gerne: blog@assono.de

Do you want an individual solution? Contact us

More interesting entries

Any questions? Contact us.

If you want to know more about our offers, you can contact us at any time. There are several ways to contact us for a non-binding first consultation.

We don’t sell your data. 100% guaranteed. See: Privacy Policy
assono GmbH

Location Kiel (headquarters)
assono GmbH
Lise-Meitner-Straße 1–7
24223 Schwentinental

Location Hamburg
assono GmbH
Bornkampsweg 58
22761 Hamburg

Phone numbers:
Human resources department: +49 4307 900 407
Marketing department: +49 4307 900 402

E-Mail adresses:
contact@assono.de
bewerbung@assono.de