I’m having some fun in a legacy application at work. The Lotus Notes/Domino forms I am creating and maintaining are embedded into an ActiveX frame (like a portal).

Prior to this application, I think all of my development has been under the assumption that my HTML form was the only form. Hence, document.forms[0] was my standard. Well, now that I’m working in this embedded application, that isn’t always true. I’ve had to rewrite some of my javascript to work with the current form.

Here’s a few of my current nuggets.

The first thing I had to create was a function to get the current form.

function getMyForm(field) {
// returns form element
	if (typeof(field) == "string") {
		for (var i = 0; i < document.forms.length;i++) {
			if (document.forms[i][field] != null) {
				return document.forms[i];
			}
		}
	} else {
		var element = field;
		while (element != null) {
			element = element.parentElement;
			if (element.tagName == "FORM") {
				return element;
				break;
			}

		}
	}

}

I am still debating how to implement the next function. I wasn’t sure if I should pass the form into the function, expect that I already have it (bad design), or get it using the function above. I actually do a mixture of the last two options. I typicall set a global form variable in the JSHeader but check for it in case it is not there.

function getFieldValues(field) {
// Returns array of values. Depends on getMyForm.
	var value = new Array;
	if (form == null || form.tagName != "FORM") {
		var form = getMyForm(field);
	}
	if (typeof(field) == "string") {
		var theField = form[field];
	} else {
		var theField = form[field.name];
	}

	if (theField.length == null && theField.options == null) {
		value =  [theField.value];
	} else if (theField.options != null) {
		for (var i = 0; i < theField.options.length;i++) {
			if (theField.options[i].selected == true) {
				value.push(theField.options[i].text);
			}
		}
	} else if (theField.length >= 0) {
		for (var i = 0; i < theField.length;i++) {
			if (theField[i].checked == true) {
				value.push(theField[i].value);
			}
		}
	} else {
		value = [''];
	}
	return value;
}

This is nothing new for a lot of developers and frameworks like jQuery and Prototype handle a lot of this. But in many instances, you’re stuck in legacy code that doesn’t allow you to throw in frameworks (or you really don’t want to have to explain what you’re doing to the other developers).

by tom | Categories: lotus, web design | No Comments

Help

Jul 2, 2008

Dear loyal readers (all two of you). I need Lotus Notes help badly.

Please ask your Lotus Notes developer friends if they’ve have any ideas on how to help me.

We just upgraded from R6 to R8 and now my namgr.exe.config or nserver.exe.config files stopped working. It’s like it can’t see them.

We were using a 3rd party COM library for a Notes app. The COM library is created using .Net framework and acts as a proxy to a (microsoft) web service. It requries a config file which must be named “[my_app_name].exe.config”.

I tried to name the config file as “notes.exe.config”, and “nlnotes.exe.config”. But it seems that Windows doesn’t work with Notes in this way.

Would appreciate any suggestion regard this.

There is a multi-beer reward.

by tom | Categories: lotus | No Comments

It’s great to read about successful Lotus Notes applications. I was browsing Linkedin when I found this:

Michael Janas’ company bid out an application but decided to develop it in-house on the Lotus platform. It’s answer #2 on the list.

I had the same requirements, looked around at software, was caught off guard by the costs and IT reqmts, so decided to use in-house talent to develop a system based on Lotus Notes. Didn’t take a lot of time to develop and only three weeks to Beta test and then launch enterprise wide with 5200 employees and 375 managers or requisitioners.

Sometimes… I just want to scream “Hey CIO! I’ve got money saving applications over here!”

Thank you Michael Janas for publishing a success story for Lotus Application development.

by tom | Categories: lotus | No Comments

My brain is like a sieve. I can’t remember simple things like how to write a “for loop.” Hence the reason I am a Lotus Notes developer… the on-line help is great.

A great find for developers like me is a table of connection strings for all types of data sources.

by tom | Categories: lotus, web design | No Comments

A couple of disclaimers… 1) We’re in the middle of upgrading to R8. Some of our mail servers have been upgraded but none of our production application servers have the new version yet. 2) This is an old (2001) application that was written for the web. I had no part of the initial development.

I discovered a small bug in the rendering of HTML in R8. It was discovered when a user was opening forms sent to a shared mailbox on an R8 server.

The Problem
Lotus Notes R8 was overlapping fields when rendering a table in the browser.

Here is what the user saw on an R8 server:
R8.1
Here is what it looks like in R6:
R8.2

The Cause
Spanned table cells/rows. In R8 (or possibly R7) Lotus decided it would help us out by rendering empty table rows (TR tags) with a style of “display:none.” Unfortunately, this affects rows that are being used by the ROWSPAN tag.

Here are the merged cells in the Notes Designer:
R8.3

Here are the split cells:
R8.4

In the browser (both versions) Notes tries to render the tables with a series of COLSPAN and ROWSPAN tags to render the table exactly the way it is displayed in the designer.

Here is the HTML from the R6 version:

<tr valign="top"><td width="50%" rowspan="4" colspan="2">2.<font color="#FF0000"> Company #: (3 digits)</font>  <font color="#0000ff">
<input name="CompanyNumber" value="" size=5></font></td><td width="50%" rowspan="4" colspan="2"><font color="#FF0000">Cost Center #: (7 digits)</font><font color="#0000ff">
<input name="CenterNumber" value="" size=10></font></td></tr>

<tr></tr>

<tr></tr>

<tr></tr>

<tr valign="top"><td width="25%"><img src="/icons/ecblank.gif" border="0" height="1" width="1" alt=""></td><td width="75%" colspan="3"><div align="right"><font color="#FF0000">Phone Number:</font>(<font color="#0000ff">
<input name="PhoneArea" value="" size=3 maxlength=3></font> ) <font color="#0000ff">
<input name="PhonePrefix" value="" size=3 maxlength=3></font> -<font color="#0000ff">
<input name="PhoneSuffix" value="" size=4 maxlength=4></font></div></td></tr>

<tr valign="top"><td width="25%"><img src="/icons/ecblank.gif" border="0" height="1" width="1" alt=""></td><td width="75%" colspan="3"><div align="right"><font color="#FF0000">Fax Number:</font>(<font color="#0000ff">
<input name="FaxArea" value="" size=3 maxlength=3></font> ) <font color="#0000ff">
<input name="FaxPrefix" value="" size=3 maxlength=3></font> -<font color="#0000ff">
<input name="FaxSuffix" value="" size=4 maxlength=4></font></div></td></tr>

Here is the HTML from the R8 version:

<tr valign="top"><td width="50%" rowspan="4" colspan="2">2.<font color="#FF0000"> Company #: (3 digits)</font>  <font color="#0000ff">
<input name="CompanyNumber" value="" size=5></font></td><td width="50%" rowspan="4" colspan="2"><font color="#FF0000">Cost Center #: (7 digits)</font><font color="#0000ff">
<input name="CenterNumber" value="" size=10></font></td></tr>

<tr style="display: none"></tr>

<tr style="display: none"></tr>

<tr style="display: none"></tr>

<tr valign="top"><td width="25%"><img width="1" height="1" src="/icons/ecblank.gif" border="0" alt=""></td><td width="75%" colspan="3"><div align="right"><font color="#FF0000">Phone Number:</font>(<font color="#0000ff">
<input name="PhoneArea" value="" size=3 maxlength=3></font> ) <font color="#0000ff">
<input name="PhonePrefix" value="" size=3 maxlength=3></font> -<font color="#0000ff">
<input name="PhoneSuffix" value="" size=4 maxlength=4></font></div></td></tr>

<tr valign="top"><td width="25%"><img width="1" height="1" src="/icons/ecblank.gif" border="0" alt=""></td><td width="75%" colspan="3"><div align="right"><font color="#FF0000">Fax Number:</font>(<font color="#0000ff">
<input name="FaxArea" value="" size=3 maxlength=3></font> ) <font color="#0000ff">
<input name="FaxPrefix" value="" size=3 maxlength=3></font> -<font color="#0000ff">
<input name="FaxSuffix" value="" size=4 maxlength=4></font></div></td></tr>

Notice the <tr style="display: none"></tr> tags? I am no HTML expert but it seems to cause issues with the ROWSPAN for cost center.

The Solution
We’re screwed. Seriously. Only testing will discover these strange renderings. I fixed the problem above by deleting the three unnecessarily merged rows. Hopefully, this was a freak occurance but be aware of how R8 is rendering your HTML.

I hope that a good night’s rest has allowed most of you to think a bit more clearly about the issue of IBM and the iPhone.

I am not a consultant. I work for a corporation (a rather large financial institution). I have worked for at most (if not all) of the large Lotus Notes shops in my area (all of which are financial/insurance institutions).

Most of the Lotus Notes shops I know of are large. They are typically insurance companies, banks, health institutions, etc. Do you really want the guardians of your private data connecting their toy iPhone to the corporate network? They lock PC’s down to the point where you cannot connect a palm pilot, use a thumbdrive, or even write to a CD/DVD. They are not going to allow iTunes and 32gb ipod/iphones. You (as the consumer) should be relieved that we take your data and privacy seriously.

Our people get Blackberries. Blackberries without a camera. These Blackberries are so locked down it is not even fun to have one. It checks mail and calendar and it’s a phone too. The CEO with an iPhone probably carries his or her blackberry as their glorified pager. I’m guessing the two will never meet and the CEO is smart enough to know why.

Should IBM invest resources into writing cool apps for the iPhone? I have offered 100 times to write applications for our corporate Blackberries. I offer up applications as simple as the corporate directory to as complex as a pipeline application. Nobody wants it.

I’m sorry you consultants can’t happily sync your Lotus Notes calendar to your iPhone. But I am not sorry enough to take resources away from anything else that Lotus is doing to try and gain marketshare by making their software better, faster, and cheaper than the competition.

by tom | Categories: lotus | 1 Comment