Switching the View Displayed in a Navigator After Document Save
Overview
In HCL Notes applications, controlling what users see after saving a document is an important aspect of the user experience.
This requirement becomes more complex when working with:
- Custom Navigators (legacy design)
- Modern Frameset-based layouts
This blog explains how to manage post-save behavior to ensure that a specific view is displayed consistently, along with design recommendations.
Problem Statement
The requirement is to control the UI behavior after saving a new document in an HCL Notes application.
Expected Behavior
After saving a new document:
-
The document should close
-
The navigation UI (Navigator/Frameset) should remain intact
-
A specific view (e.g., “EMP\Category”) should be displayed
Actual Behavior
-
The document closes successfully
-
The navigation UI remains visible
-
However, the previously active view continues to be displayed
-
The target view is not automatically selected or refreshed
Root Cause
This behavior occurs due to how HCL Notes manages UI context and navigator state:
-
Navigators maintain their own internal state independently
-
Source.Close only closes the document window
-
The currently active view remains unchanged in memory
-
Reopening a navigator does not enforce switching to a different view
As a result, the system continues to display the previously active view instead of the intended target view.
Navigator-Based Approach
Challenges with Navigators
When using a custom navigator (e.g., AddNavigator):
-
The navigator maintains its own UI state
-
Closing a document does not affect the active view
-
View switching is indirect and state-dependent
-
UI behavior may vary depending on user interaction
Workaround for Navigator
To achieve the expected behavior, the UI context must be explicitly reset.
LotusScript Implementation (PostSave Event)
Add the following code in the PostSave event of the form:
Sub Postsave(Source As NotesUIDocument)
Dim ws As New NotesUIWorkspace
Dim uidb As NotesUIDatabase
Set uidb = ws.CurrentDatabase
’ Close the document
Call Source.Close
’ Close current UI context (including active view)
Call uidb.Close
’ Reopen navigator
Call ws.OpenNavigator(“AddNavigator”, 0)
End Sub
Result
- The previous view is closed
- The navigator reloads cleanly
- The desired view can be displayed via navigator selection
- A slight delay may occur due to UI refresh (expected behavior)
Limitations
-
View control is indirect and dependent on navigator state
-
Behavior may vary across environments
-
Not ideal for complex or dynamic UI requirements
Frameset-Based Approach (Recommended)
Why Framesets?
Modern HCL Notes applications typically use:
- Outlines (for navigation)
- Pages
- Framesets
This approach provides:
- Clear separation of navigation and content areas
- Direct control over where views are displayed
- More predictable and stable UI behavior
Frameset Implementation
Formula Example
@Command([CloseWindow]);
@Command([OpenFrameset]; “MainFrameset”);
@SetTargetFrame(“Right”);
@PostedCommand([OpenView]; “02. By Category”)
LotusScript Example
Dim ws As New NotesUIWorkspace
Call ws.OpenFrameSet(“MainFrameset”)
Call ws.SetTargetFrame(“Right”)
Call ws.CurrentDatabase.OpenView(“02. By Category”)
Result
- The navigation panel remains intact
- The target view opens in the designated frame
- No dependency on previous UI state
- Consistent and predictable behavior
Advantages Over Navigator
| Feature | Navigator | Frameset |
|---|---|---|
-
UI Control Limited Strong
-
View Targeting Indirect Direct
-
Predictability Medium High
-
Design Approach Legacy Recommended
Recommendation
-
Use the Navigator workaround if redesign is not feasible -
Prefer a Frameset-based design for:-
Better UI control
-
Scalability
-
Long-term maintainability
-
Final Outcome
With the appropriate implementation:
-
The document closes successfully after saving
-
The navigation UI remains intact
-
The required view is displayed consistently
Conclusion
Managing post-save navigation in HCL Notes depends heavily on the underlying UI design.
Navigator-based implementations require explicit UI reset handling
Frameset-based designs provide more reliable and controlled behavior
For long-term stability and improved user experience, adopting a frameset-based architecture is strongly recommended.