Controlling View Behavior After Document Save in HCL Notes (Navigator and Frameset)

Switching the View Displayed in a Navigator After Document Save
:magnifying_glass_tilted_left: 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.

:puzzle_piece: 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

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

:compass: Navigator-Based Approach
:warning: 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

:light_bulb: Workaround for Navigator

To achieve the expected behavior, the UI context must be explicitly reset.

:wrench: 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

:test_tube: 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)

:pushpin:Limitations

  • View control is indirect and dependent on navigator state

  • Behavior may vary across environments

  • Not ideal for complex or dynamic UI requirements

:brick:Frameset-Based Approach (Recommended)
:white_check_mark: 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

:light_bulb: Frameset Implementation
:small_blue_diamond: Formula Example
@Command([CloseWindow]);
@Command([OpenFrameset]; “MainFrameset”);
@SetTargetFrame(“Right”);
@PostedCommand([OpenView]; “02. By Category”)

:small_blue_diamond: LotusScript Example
Dim ws As New NotesUIWorkspace
Call ws.OpenFrameSet(“MainFrameset”)
Call ws.SetTargetFrame(“Right”)
Call ws.CurrentDatabase.OpenView(“02. By Category”)

:test_tube:Result

  • The navigation panel remains intact
  • The target view opens in the designated frame
  • No dependency on previous UI state
  • Consistent and predictable behavior

:pushpin:Advantages Over Navigator

Feature Navigator Frameset
  • UI Control Limited Strong

  • View Targeting Indirect Direct

  • Predictability Medium High

  • Design Approach Legacy Recommended

:rocket: Recommendation

  • :white_check_mark: Use the Navigator workaround if redesign is not feasible

  • :counterclockwise_arrows_button: Prefer a Frameset-based design for:

    • Better UI control

    • Scalability

    • Long-term maintainability

:white_check_mark: Final Outcome

With the appropriate implementation:

  • The document closes successfully after saving

  • The navigation UI remains intact

  • The required view is displayed consistently

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

1 Like