Manage Learn to apply best practices and optimize your operations.

Refreshing forms on the Web

The Notes Client paradigm is not easily emulated on the web. But with a few behind-the-scenes tricks, you can implement the most powerful hide-when and computed field functionality - without saving the document until you're ready.

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 we want to scroll down to:

<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.

Dig Deeper on Domino Resources - Part 7



  • Favorite iSeries cheat sheets

    Here you'll find a collection of valuable cheat sheets gathered from across the iSeries/ community. These cheat ...

  • HTML cheat sheet

    This is a really cool cheat sheet if you're looking to learn more about HTML. You'll find just about everything you every wanted ...

  • Carol Woodbury: Security

    Carol Woodbury