Focus on a doc when changing views, without Navigator

Try this method for changing views, and staying on the same document. It's particularly interesting for developers who can't use Navigator.

Navigator includes a built-in function that lets you move from one view to another, and stay on the same document if both views include the document. But what if you can't use Navigator in your design? The application I have been working on previously used Navigator. However, Navigator can't be read by screen-reader software (for blind people), and we must change our application to comply with a new corporate accessibility policy. It's...

also rumored that Lotus may not continue to support Navigator in the future.

Each view should have a first hidden column that is sorted. The column value can be a particular field value plus the document's UNID (shown in sample code below) or anything that is unique. Note: if your views show response documents (like what we have, and what I show below, which is for views containing response documents), you can only go to or keep the focus on the top-level document. If you have flat views, you can go to any document.

Code: First hidden column value formula (ShortName is a field on every one of our top level/non-response document; the view must be sorted on this first column):

@If(!@IsResponseDoc; ShortName 
+ @Text(@DocumentUniqueID); "")

In QueryOpen event of each view, we set the current view name to an environment variable:

@SetEnvironment
("MyApp_CurrentViewName";
 "Actual_View_Name")

In PostOpen event of each view, we get the current view name and the key of the top-level document we were on in the previous view from environment variables, and then we move our focus to this top-level document (specifying the view name save the application from opening up a new window):

key:=@Environment
("MyApp_CurrentViewTopDoc");
viewName:=@Environment
("MyApp_CurrentViewName");
@Command([OpenView]; 
viewName; key; "")

In QueryClose event of each view, we set the current top-level document key in the environment variable so the next view can use it (TopDocUNID is a field that is on every document in our database, including the top-level document itself; the field contains the top-level document UNID that indicates which top-level document this document is under. "Main" is the form name of our top-level document. The reason I use @IsError is that if there is no document being highlighted/selected in the view, we do not get an error trying to get document properties.):

@If(@IsError(@GetDocField
(TopDocUNID; "ShortName")); "";
 @Do( 
  key:=@If(@IsMember("Main"; Form); 
        ShortName + @Text
(@DocumentUniqueID); 
        @GetDocField(TopDocUNID;
 "ShortName") + 
@GetDocField(TopDocUNID; 
@Text(@DocumentUniqueID)));
  @SetEnvironment
("MyApp_CurrentViewTopDoc"; key) 
 ) 
) 

Do you have comments on this tip? Let us know.

This tip was submitted to the SearchDomino.com tip exchange by member Long Yu. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

This was first published in June 2004

Dig deeper on Lotus Notes Domino Formula Language

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com'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 ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close