IBM®
Skip to main content
    Country/region select      Terms of use
 
 
   
     Home      Products      Services & solutions      Support & downloads      My account     

developerWorks  >  Lotus  >  Forums & community  >  Best Practice Makes Perfect

Best Practice Makes Perfect

A collaboration with Domino developers about how to do it and how to get it right in Domino

Today's problem: use LotusScript in a page in a frameset, to open a view from a different database in one of the other frames. We don't know at design time what the target database is. We can't change the design of the target database.

NotesUIWorkspace.OpenDatabase always opens in a new tab, so that doesn't help. We can only replace a frame's contents with an element from the same database where the code is running (using OpenView, ComposeDocument, and so forth).

single-frame redirection framesetThe solution I came up with uses a second frameset with just one frame in it. Select "URL" for Type, click the "@" button, and write a formula that reads information from an environment variable or personal profile document, to compute a Notes URL (or you can choose Named Element and write three formulas for element type, database filepath and name). Essentially, when this frameset is opened, it redirects you to whatever's in the Notes URL.

Now you can use SetTargetFrame and NotesUIWorkspace.OpenFrameset to open the "redirect frameset" in the other frame, and that will execute the formula and open the foreign view.

Sub Click(Source As Button)
   Dim dest$
   dest = "notes://etcetera"
   Dim wksp As New NotesUIWorkspace
   Dim session As New notessession
   Call wksp.SetTargetFrame("Frame2")
   Call session.SetEnvironmentVar("FSTarget", dest)
   Call wksp.OpenFrameSet("NavFS")
End Sub

Note: if you can change the design of the target database, I'm told (by Rocky Oliver) that you can instead design a form with a Queryopen event that always sets Continue=False, and uses OpenView or whatever to display the desired design element in the frame. I didn't try it.

Andre Guirard | 17 August 2007 04:00:00 PM ET | Café Porch, Plymouth, MN, USA | Comments (1)

Search this blog 

Disclaimer 

    About IBM Privacy Contact