« SuperNTF 0.9.7d Released | Main| Niklas Waller's Super Collection of Web Graphic Links »

Cool SuperNTF Tricks: Show Design Elements in Regular Notes Views

Category    

SuperNTF LogoIn my recent post about using Notes @Formula language to compute a database's an application's "Master Template" name, we learned about the $FormulaClass hack that allows regular Notes views, which most folks think can only display regular documents, to also display design elements (no, I'm not kidding). By pure coincidence, the very next day our good friend Andre Guirard published an article all about this technique, and included a particularly helpful reference to all the various $Flag values and how they can be used to help determine the type of element(s) to display.

The example "Database Info" view in my earlier post gave but a small glimpse into the power of this technique, since it was designed to only display a single element, the database icon. SuperNTF relies heavily on this technique in several other areas, such as anytime you need to compute a list of forms, views, images, or whatever. The usual technique for collecting such lists is to rely on LotusScript to build them during a form PostOpen event, which is often an annoyingly slow operation. In SuperNTF, you need little more than a quick and simple DbLookup to grab such lists.

The View and Form Configuration forms are perfect examples of the utility of this approach. In both cases there are several dialog list fields on the form that allow an application administrator or developer to select from a list of forms or views. If you look at the top of those forms in Domino Designer you will see several "hidden" fields, among which you will find such cryptically named ones like "ViewList" and "FormList" (bonus points for guessing what those are for ). In turn, all the visible fields that need to present the corresponding lists point to those hidden fields, so the lookup computations are only performed once for the entire form.

But wait, there's more!

As cool as doing simple lookups against views of design elements is, SuperNTF offers several user-, or rather developer-facing views of design elements that do tricks Domino Designer can't. A single view of ALL design elements, categorized by element type but also sortable by name, alias, last save date, last saved by, etc.? With view actions for things like toggle "prohibit refresh/replace flags" or "clean and sign selected elements", or import design elements saved as DXL? As you wish:

A picture named M2

Or how about a view of all image resources showing the actual images IN THE VIEW? Don't try THIS with Domino Designer:

A picture named M3

You will find the above views, and a bunch of other useful gems, in the latest release of my SuperNTF Notes application framework template. To find them, open the "Administration" panel and look under "Design Tools".

A picture named M4

 If you want to copy the views to another application, their names are prefaced by "DESIGN - " in the view list. In that case, you'll also want to copy the following additional elements:

- Agent: "(DESIGN - Import DXL Design Elements)"
- Forms: "DESIGN - Smart Preview Form" and "DESIGN - Image Preview"
- Image Resources: "Inherits from template", "Prohibit Refresh/Replace", "SNTF_btn_Design_24x20x3.gif", "SNTF_btn_Template_24x20.gif", and "SNTF_btn_Tools_24x20.gif"

For additional insight into the $FormulaClass tricks used to create these views, you can check out:

- Dan Velasco's DominoPower article Fun with $FormulaClass
- Julian Robichaux's blog entry Modifying $FormulaClass in Views
- Vince Schuurman's $FormulaClass Hack piece
- Ytria technote How to create views that list design elements by changing the $formulaclass item using ScanEZ

Also, I wanted to mention Andrew Barker who I credit for getting me started on the convoluted formula used to sift out what type of design element a given "document" represents. His "Elemental" OpenNTF submission seems to have disappeared, but all the same it was a big help.

Comments

1 - Hey Kevin

Thanks for the hat tip.

I like what you're doing with it.

Dang, I miss developing!

Drew

2 - Very cool, Kevin. I look forward to learning a lot more about it in the next four days : )

3 - Hi Kevin,

I tried this. This looks awesome.

Emoticon Emoticon

PS: Form fields also included fields that are for display. These are not returned. Can you do something about it.


Also, About Database Document and Using Help Document do not have same NoteIDs. I tested several of these, by viewing design properties and I find them different from each other.

4 -
Hi Kevin,

Great tip!!

I was just wondering if this technique can be used for programmatically adding field on a form and set the attributes. The layout/formatting may not be there at least the fields get created and then use the designer to place the fields where you want.

Any thoughts on that?

Regards,
Anand

Post A Comment

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

Your Host

KevinPettitt.jpg
Kevin Pettitt View Kevin Pettitt's profile on LinkedIn

Tools I Use

Idea Jam

Subscribe to This Blog

 Full Posts  Comments

MyYahoo
netvibes Add to Netvibes

Contact

Hosted by

OpenNTF

Disclaimer

This site is in no way affiliated, endorsed, sanctioned, supported, nor blessed by Lotus Software nor IBM Corporation, nor any of my past or future clients (although they are welcome to do so). The opinions, theories, facts, etc. presented here are my own and in no way represent any official pronouncement by me on behalf of any other entity.

© 2005-2017 Kevin Pettitt - all rights reserved as listed below.

Creative Commons License
Unless otherwise labeled by its originating author, the content found on this site is made available under the terms of an Attribution / NonCommercial / ShareAlike