Facts: Domino can generate Javascript equivalents for @Commands executed by links, buttons, etc.
Problem: In order to use these in JavaScript where YOU want (form.onsubmit, called by generated JavaScript, etc.) you have few viable options (hidden layers, "sacred" subforms, etc.). Previous solutions get the job done (usually), but can create more headaches than they are worth.
Solution: Using a simple process, you can access the power of @Commands in JavaScript without
the usual headache.
1. Create an action hotspot. The contents can be spaces, or (my preference) a passthrough HTML
comment indicating the @Command being setup.
2. In the hotspot's frame property (properties window, first tab), enter some kind of identifier
for the @Command being setup. Don't use the @ symbol, though. Javascript won't like it.
3. In the onLoad event of the window, cycle through the document.links array looking for the link
whose target matches the identifier you used.
4. Once you have found the right link, you can assign it's onclick event to whatever you want, and
call it however you want. Note that in order to assign the onclick event to another JavaScript
object, you must refer to it all in lowercase, and omit the parentheses (otherwise you will assign
the return value of the onclick event you want to assign).
Q&A:
Q: What if users click on the link?
A: The link doesn't show. It's invisible. In my tests, it
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
Q: What about the target frame? It doesn't exist. Is that a problem?
A: No. Again, it cannot be clicked.
Q: Where have you tested it?
A: NS 4.7 and 6.0-1, and IE 5.5. I would expect similar for IE 4.
This was first published in October 2001