Domino Code Fragment

Code Name*
Preventing UI refresh when working with Framesets
Date*
07/08/2000
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.
Description*
On the Web instead of having your forms reload constantly, create a Frameset where one frame has a size of zero. Open a form in each frame. Using JavaScript to react to button presses or other actions, move the data you want to submit to the hidden frame and force the submit of that document. Now your UI doesn't refresh and the user still executes the submit action.
Type*
JavaScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

For example, the top frame, frame[0], might have a button with the formula:

  OnClick='parent.frames[1].additem("some value")'

This would execute a JavaScript routine in the bottom hidden frame such as:

  function additem(str) {
           document.forms[0].cartRow.value = str;
           document.forms[0].submit()
  }

The submitted document does something useful (loggs an event, updates a document, updates a profile, etc.) and in it's $$Return field you simply create another form so the user can submit again and again without affecting the visible display. A $$Return value might be:

      "[/" + @RepalceSubstring)@Subset(@DbName;-1);" " : "\\" ; "+" : "/") +
      "/ThisFormName?OpenForm]"