Some Notes Client functionality is automatically available on the web. For example, when you have a radio button with two possible values, and it is set to refresh fields on keyword change. Domino achieves this in the browser using JavaScript with a special function called _doClick(). Basically, when you change the value of the radio button, the _doClick function tells Domino which field has been clicked. This allows Domino to re-compute the form based on the new field value. In addition, it returns the form to the browser with an anchor-link so that the browser scrolls down to the field that has just been clicked.
Now to put this knowledge to work. Lets say we have a collection of computed-for-display fields similar to a mini-spreadsheet on our form. We also have one editable field that is used in the formulas of the computed fields. Lastly, we have a refresh button so that changes in the editable field take effect in the computed fields.
The JavaScript code behind the button is: _doClick ('refresh', this, null, null)
This code alone will refresh the form without submitting it.
Now, to make the browser scroll down to where we previously were, we need to create a pass-thru HTML code at the point
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.
<A NAME="anchor1"></A>
This is called an Anchor Link. For Domino to take advantage of it, the code must now look like this:
_doClick ('refresh', this, null, 'anchor1')
That's it! Don't forget to enable "Use JavaScript when generating pages" in the database properties.
This was first published in April 2001