SetTargetFrame and getting the uidoc

For a new template I got inspired a bit by Chris Blatnick’s post on cascading menus and the left navigation pane in OpenTV’s template on OpenNTF. Take a look here:

my frameset
my frameset

The ‘problem’ that I am facing now is that I want frame A (the one with the cascading menu) talk with frame B (the one with the collapsible tables).

Opening a frame is not a problem with

Call ws.SetTargetFrame(“frameB”)

But is it possible to set a value in frameB from frameA? Frame B contains a form. Normally if you would click on an icon on the right you set a field and refresh the hidewhenformula’s:

 If uidoc.FieldGetText(“nav_option”) = “0” Then
  Call uidoc.FieldSetText(“nav_option”, “”)
  Call uidoc.Refresh
 Else
  Call uidoc.FieldSetText(“nav_option”,  “0”)
  Call uidoc.Refresh
 End If

I tried & searched the web and did not find a solution yet, basically this is how I would like to have my code look like:

Sub Click(Source As Button)
 Dim ws As New NotesUIWorkspace
 Dim session As New NotesSession
 Call ws.SetTargetFrame(“frameB”)
 Call ws.OpenFrameSet(“MenuFrame”) ‘<- frameset containing the form
 
 Dim uidoc As NotesUIDocument
 Set uidoc = ws.CurrentDocument ‘<- does not work uidoc is not recognized
 
 Call uidoc.GotoField( “nav_option” )
 Call uidoc.FieldSetText(“nav_option”,”1″)
 Call uidoc.Refresh

‘updating the right pane: 
 Call ws.SetTargetFrame(“NotesView”)
 Call uidb.OpenView(“Main Structure”)
End Sub

Anybody has a hint ???

Advertisements

3 thoughts on “SetTargetFrame and getting the uidoc

  1. Chris Toohey 2008-November-6 / 11:14 pm

    Two words sir: Environment Variables!

    1) Design your Form to look to a group of environment variables to define their values. If the environment variables are not found, the values of your fields will be blank…
    2) Now that you’re basing this off of the environment variables, you pre-set the EVs as needed and simply open your Form.

    The added bonus with this approach is that you can set EVs and open the Form through LS *OR* Formula!

    HTH,

    -Chris

  2. Charles Robinson 2008-November-6 / 11:33 pm

    Another option is to use a profile document that you never save. It exists in memory and can be used as a sort of global catch-all. And it doesn’t clutter the notes.ini with environment variables. I’ve been using that successfully for a while.

  3. Corey Kimball 2008-November-7 / 1:44 pm

    After you open the “MenuFrame” frameset try setting the target frame to the frame in the “MenuFrame” frameset that contains the document. For example, if the MenuFrame frameset has a frame called “main” to hold the document then you would set the target frame as “main” and then call the uidoc stuff.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s