Manage Learn to apply best practices and optimize your operations.

Return to the view the final solution

Return to the view while preserving view location and status (expand & collapse)

Return to the view while preserving view location and status (expand & collapse)

Imagine this scenario:
1 - The user is presented with a view.
2 - The user expand the view.
3 - The user scroll foreword a few pages.
4 - The user decide to add, update or delete a document.
5 - the appropriate action is preformed by the system and the user is presented with a view.

In the many samples I looked into the view presented at step 5 is:
- Hard coded.
- The view is presented from the start and does take into account step 2 and
3 (Scroll and expand).

To overcome this problem I came up with this solution:

The solution is based on the thought that if I can save the view status (location & expand) somewhere then I can refer to it and use it later on.


In my applications I usually use frames. On the left frame I keep the pages with Outlines. Views are presented in the right frame.

In the page that goes into the left frame I created a field using Pass Through HTML:

[<INPUT  name=LocationHrefSave TYPE=hidden>]

Capture the View status
In the $$ViewTemplate for the view in the onLoad event I entered:

// Save the view location & status
parent.LeftFrame.document.forms[0].LocationHrefSave.value =
location.href ;

Note: LeftFrame is the name of the left frame.

Return to the view
I created a page named ReturnDocumentProcessed I also created the
page $$ReturnDocumentDeleted.

In the ReturnDocumentProcessed I put the text
"The Document Has Been processed !!!"

In the $$ReturnDocumentDeleted I put the text
"The Document Has Been Deleted !!!"

The code for those pages is the same.
1. In the JS Header I entered:

function NextStep() {
location.href = parent.LeftFrame.document.forms[0].LocationHrefSave.value;

2. In the onLoad event I entered:
TimerID = setTimeout("NextStep() ",1000)

The timer allow the user to see the text in those pages for a second and then the view is presented, Any changes in the data is shown as well.

Dig Deeper on Domino Resources - Part 6

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...