Ben Langhinrichs

January, 2015
    01 02 03
04 05 06 07 08 09 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Search the weblog

Genii Weblog

Notes/Web Coexistence Tip #1

Thu 23 Oct 2003, 10:07 AM

by Ben Langhinrichs
In the template for the Notes 6 Gold forum, which is available in the Sandbox, I happened to notice the following code:

<SELECT name="URLpick" onChange='/forum/'+this.options[this.selectedIndex].value,'_top')>
                        <OPTION VALUE=""  SELECTED>Select view</OPTION>
<OPTION VALUE="/DateAllThreadedWeb?openView">Date (threaded)
<OPTION VALUE="/DateAllFlatweb?openView">Date (flat)
<OPTION VALUE="/DateAllwithExcerptWeb?Openview">With excerpt
<OPTION VALUE="/AuthorAllThreadedWeb?Openview">Author
<OPTION VALUE="/CategoryAllThreadedWeb?Openview">Category
<OPTION VALUE="/PlatformAllThreadedWeb?Openview">Platform
<OPTION VALUE="/ReleaseAllThreadedWeb?Openview">Release

squished into a table cell along with lots of other passthru-HTML.  It took me a moment to realize that this was the solution the developer had found for a combo-box that automatically follows the link when a selection is made, as opposed to having to press a Go button after selecting.  Now, while Web UI designers may dislike this type of combo-link, companies who pay Web UI designers love it.

So, my question is, why would you write this in passthru HTML?  It is difficult to read, must be deciphered as opposed to recognized, and can be done in a more standard way with Notes constructs, which make the design a good deal more WYSIWYG (a fairly popular goal as far back as the 1980s).  All you have to do is create a dialog list field called URLpick with the following choices:

Select view|
Date (threaded)|DateAllThreadedWeb
Date (flat)|DateAllFlatweb
With excerpt|DateAllwithExcerptWeb

and then set the field's onChange event to:'/forum/'+this.options[this.selectedIndex].value+'?openView','_top')

You get the same effect, and even the exact same HTML generated, but what you have is recognizably a combo-box, it fits in the cell and the whole design is easier to see.

So, which do you think should be used?  The HTML, as this is a web design element and web developers will be looking at it?  The combo-box, for readability and WYSIWYG?  You decide.

By the way, if you came to my session at the UK Admin-Developer conference in London next Monday on Advanced Notes/Web Coexistence, you could see more of these tips, and hear a more detailed argument for using Notes constructs in this scenario.  You might also find out some interesting ways you could use these web tricks in the native Notes client.  There is still time to sign up for the conference (especially if you live near London and don't have to worry about airline tickets).

Copyright © 2003 Genii Software Ltd.

What has been said:

64.1. Neill Laney
(10/23/2003 08:48 AM)

Ben, I respect your expertise and have been following your posts for some time.

The main problem that I have with using Notes for web development is exactly what you've just described - making the transation between what the browser interprets, and how to generate the code in Domino.

But then, I'm not a WYSWIG fan, either. GUI interfaces are terrific, but no competent, self-respecting developer of is going to use a tool where you can't see under the covers. Take any presentation layer, and if you don't have the mechanism to see the underpinnings, then you have a layer that cannot be shared universally, and why XML and CSS will replace them, IMO.

Laney Consulting

64.2. Ben Langhinrichs
(10/23/2003 08:57 AM)

These are good points. I wish it were easier to sit in the designer and say "See the HTML". I know you can preview and view source, but it is hard to see a side-by-side view that shows a WYSIWYG view and the generated HTML.

For what it's worth, my session is focused on ways to share a design between Notes and Web, when to do it and when not, and that sort of thing. This isn't a great example of that, but addressed a question I have been asked many times and have seen posed many times, which is how to make a combo-link box.

64.3. Nathan T. Freeman
(10/23/2003 09:14 AM)

I've said it before and I'll say it again: the use of pass-thru HTML is indicative of a failure, either on the part of Domino or on the part of the developer.

Why do this with a native Notes field? Interoperability is nice, but the more important point is maintenance. By using pass-thru, it becomes necessary to update and syntax-check some 500 characters of code. By using an actual IDE control, the only *code* applied here is the JavaScript. If you want to update the list of available views, it's easy. Want to make them programmatically generated? No problem. Want to update them to point to databases other than the current one? It's just a alias change. Want to move your control to a different part of the form? Just cut & paste the completely obvious object that is the combobox in Designer.

The HTML generated by a development tool *should* be primarily irrelevant to the developer. When you're working with C code, do you really take a deep look at the byte-code generated by your compile? Maybe if you're writing Doom III, sure, but the entire purpose of higher-level languages is to shield the developer from unnecessary details. ASPs, JSPs and Domino are all similar in this respect. That's not to excuse *bad* HTML generation by some tool, (Frontpage, for instance) but the quality of a web development tool should be determined by its ability to properly shield those layers and let the developer focus on relevant tasks instead of data entry.

64.4. Stan Rogers
(10/23/2003 10:31 AM)

I'm going to be a bit more generous here, and posit an alternate scenario. We all know that there have been more than a few cooks involved in the making of the forum broth -- the design is rarely stable for more than a couple of months. I would suggest, then, that the passthru as it now stands once lived on a Page (in hopes of exploiting caching behaviour, I'd expect), or was shared between one or more Pages and Forms and now resides exclusively on Forms. It was never touched (except to edit the view list) or really even questioned. Does that make it excusable? No -- but it does make it historic.

64.5. Ben Langhinrichs
(10/23/2003 11:15 AM)

I hope I didn't come off as too critical of those who have developed the forum template. While it may be that, as you suggest, it was originally somewhere else, I do think many developers feel that if they start needing to do anything web-like, they should switch over to HTML, and a great deal has been added to the Designer to allow you NOT to have to do that.

64.6. Mouny
(06/29/2004 02:29 PM)

Hello Sir,

I need a text popup on web for dialog box

(Allow multivalues is selected).

When the cursor is on the list box I need to show the selected value as a text popup.

Please let me know how I can do this.

Thank you in advance.