Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Graphic Tabs on Form

I am starting a new db and am creating a form which will have a wide range of data related to an office. I am looking at setting it up where at the top of the form I have a series of tabs, similar to the tabbed table setup, standard in note, but I want to use a sharper web style tab, I tried to see if I could add a graphic to the tabs in the table, but that does not seem to be an option.
Each tab will have certain information about the office (e.g. Address, staffing, system info, statistics.) I have just started working with Framesets and was trying to work things that way, I have a TabPage in the top frame of a framset, but not sure if this method will work to get the office details in the lower frame.

What is my best method to allow me to have the user click on the various tabs and have the details for that office appear below the tab setup.

Joe
0
jforget1
Asked:
jforget1
  • 13
  • 11
  • +1
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Make a programmed table, so you can show and hide rows with hotspot pictures. See the designer help on Programmed Tables. There's an interesting article about it:
    http://www.dominoguru.com/pages/contextsensitive_tabbednavigation.html

The other day, Marilyn posted a similar article... Can't find it.
0
 
jforget1Author Commented:
Page does not seem to want to open, I will try again in a bit. But it is good to know it is possible.
0
 
cezarFCommented:
or if you want to pursue framsets, you need to use @SetTargetFrame to open the details in your lower frame. if you are using an anchor HTML tag (<a>), you can include target="framename" so that the link will open in the desired frame.

programmed tables seems neat as suggested by sjef_bosman. haven't tried them though.

hope this helps.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
jforget1Author Commented:
Sjef, thabnks I will try this method.
0
 
Sjef BosmanGroupware ConsultantCommented:
Welcome! :)
0
 
jforget1Author Commented:
I am trying to get this going but I think I am doing somrthing wrong. When I do a programmed table, but when I enter the code for the cell, it displays each graphic in the cell below the tabs. What type of table do I setup. How do I configure these so it has the graphics all in the top row "tabs", with an available cell for a nested table of information.
0
 
Sjef BosmanGroupware ConsultantCommented:
I think you'd have to create two tables, the first is a normal table with only one row containing your tabs, and the second is the programmed table.
0
 
jforget1Author Commented:
OK I have been making progress but I am running into an issue I can't figure out here.

Am getting an Object Varible Note Set error on this line from the code below:If uidoc.editmode Then
I have tried adding the Set commands above this but it keeps failing. This is in a Script Library I am calling.

Sub OnClickTab ( w As NotesUIWorkspace, s As NotesSession, uidoc As NotesUIDocument, doc As NotesDocument, row As String )
' FUNCTION: OnClickTab ( w, s, uidoc, doc, row )
' PURPOSE: Change the row the the programmable table
' ARGUMENTS:
'      w ( NotesUIWorkspace ) - global ui workspace
'      s ( NotesSession ) - global session
'      uidoc ( NotesUIDocument ) - notes ui document
'      doc ( NotesDocument ) - notes backend document
'      row ( row ) - row to set
      
      If uidoc.editmode Then
            Call doc.ReplaceItemValue("$row", row)
            Call uidoc.refresh
      Else
            Call s.setEnvironmentVar("RevolutionRow", row)
            Call uidoc.close
            Call w.EditDocument(False , uidoc.Document)
      End If
      
End Sub
0
 
jforget1Author Commented:
These are the items on the form

Declarations:
Dim s As NotesSession
Dim w As NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As Notesuidocument

Sub Queryopen(Source As Notesuidocument, Mode As Integer, Isnewdoc As Variant, Continue As Variant)
      
      Set w = New NotesUIWorkspace
      Set s = New NotesSession
      Set db = s.CurrentDatabase
      Set uidoc = source
      
      Call InitializeRow ( s, uidoc )
      
End Sub

Sub Postopen(Source As Notesuidocument)
      
      Set doc = source.Document
      
End Sub

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
      
      Call FinalizeRow ( s, source )
      
End Sub
0
 
Sjef BosmanGroupware ConsultantCommented:
One of the objects has no value (or Nothing). Can you test with the debugger? What is the complete call to OnClickTab??

Just a hint: calling New NotesSession or New NotesUIWorkspace many times isn't a problem: there is only ONE of those objects ever available. Each time you use New, you will get the same object. Putting them in a Global space is neater but not more efficient.

Another problem: when you call uidoc.Close from a form, the code AFTER that call will never be executed.
0
 
jforget1Author Commented:
Most of this code is right from that site you recomemended. I have run it through debugger and it give me the OVNS error at the first line, it no longer seems to have a handle on s, ws, doc etc. even though that is set on the QueryOpen event. Somehow it seems to lose the info when it goes to the OnClickTab function.

Not sure what you mean by the complete call for the OnClickTab, All that code is above.
0
 
marilyngCommented:
Just a note here..

Usually when I do the programmatic tables, if you want nice graphic buttons, you put these above or below the programmatic tables.  YOu have to edit each row in the programmatic tables  so that the programmatic table has a name, and each row has a name or ID.

So, you have a table:  maintable
  Look in the Table Properties, and the NAME/ID of the TAble = maintable
it has three rows:  R1, R2, R3
  Look in each ROW properties and set R1 = "R1", etc.

When you click on graphic 1, you want row 1 to display
when you click on graphic2, you want row 2 to display
when you click on graphic3, you want row 3 to display

At the top of your form is  simple text field, editable, called $maintable with a default value of "R1" - so when you open the form, no rows are visible, or "R1" is visible


Your graphic tabs can either use an "onclick" event, or a hotspot:

@SetField("$Maintable";"R1");
@Command([ViewRefreshFields]);
@Command([RefreshHideFormulas]);
--------------------or-------------------------------

doc.~$Maintable = "R1"
Call uidoc.refresh
Call uidoc.Refreshhideformulas()
0
 
Sjef BosmanGroupware ConsultantCommented:
I just knew you couldn't resist... :-D

First requirement: add a line in the Options-section:
    Option Explicit
So you'll know all variables are declared before use.

You have to put the global variables of the form really global, i.e. in the (Globals) Formname part of the form. Otherwise, the Click-button will not have access to them.
0
 
jforget1Author Commented:
I have the Dims below in the Global declarations
Dim s As NotesSession
Dim w As NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim uidoc As Notesuidocument

And the code below to set the script library
Option Public
Use "OnClickTab"

Seems like when it goes to the OnClickTab event it no longer has a handle on any of the items, it has them in the previous QueryOpen and PostOpen events.
0
 
jforget1Author Commented:
One other thing I am not sure how to setup is when I use a computed cell in the table to get the graphic, how do I add a hotspot, I only seem to be able to add a hot spot when I add a picture.

Can I add code to use a @Function to have the image change to the "active/over" state and then go back to the normal state when released. I can't get the button to react to the click.
0
 
Sjef BosmanGroupware ConsultantCommented:
Which declarations section? You have to be in the (Globals) Formname part of your form, the topmost in the Objects reference window. You have to put these declarations there. Otherwise, the button's code doesn't know where to find the variables mentioned in the code. The compiler doesn't go looking for the declarations in the Form declarations, but only in the (Globals) (declarations).

And where is Option Explicit ?? Add this option to the button's options section and you'll see what I mean.
0
 
Sjef BosmanGroupware ConsultantCommented:
Just a hint: look in the Programmer's Pane (Alt-Enter), 2nd tab, and enable "Automatically add 'Option Declare'" . Option Explicit and Option Declare are equivalent.
0
 
jforget1Author Commented:
"Which declarations section? You have to be in the (Globals) Formname part of your form, the topmost in the Objects reference window. You have to put these declarations there. Otherwise, the button's code doesn't know where to find the variables mentioned in the code. The compiler doesn't go looking for the declarations in the Form declarations, but only in the (Globals) (declarations).

And where is Option Explicit ?? Add this option to the button's options section and you'll see what I mean."

I have the Dims in the Form level global declarations. I added to the Option Explicit to each button

Option Explicit
Use "OnClickTab"


"Just a hint: look in the Programmer's Pane (Alt-Enter), 2nd tab, and enable "Automatically add 'Option Declare'" . Option Explicit and Option Declare are equivalent."

I enabled this option in the programmers pane, not sure if it is retroactive and will add to the form I have already created.
0
 
Sjef BosmanGroupware ConsultantCommented:
There are, in the window with the Objects reference etc, a lot of objects, like

    - ABCD (Form)
        Window Title
        HTML Head...
        ...

but there us a section before that, you may have to scroll up to see it:

    + (Globals) ABCD
    - ABCD (Form)
        Window Title
        HTML Head...
        ...

When you open the very first line, with the +, you'll see
    - (Globals) ABCD
        x (Options)
        x (Declarations)
        ....
    - ABCD (Form)
        Window Title
        HTML Head...
        ...

You have to put your declarations in that very first section of your form. Are they in there?
0
 
Sjef BosmanGroupware ConsultantCommented:
It's not retroactive, one of the serious misconceptions in the Designer.
0
 
jforget1Author Commented:
I have put them into that section for the global declarations, I am checking with the guy who wrote that code to see what I am missing here. Will let you know what the final fix ends up being.
0
 
Sjef BosmanGroupware ConsultantCommented:
I'd love to see it. If you think it would be useful if I had a copy of the form you're testing, put it into an empty database, zip it and send it to me. My address is in my EE-profile, somewhere in the middle.
0
 
Sjef BosmanGroupware ConsultantCommented:
Heh, you defined all variables both in the (Globals) section and in the Form section. Now there exist two sets of variables with the same name, in different spaces. The functions in the form will access the variables declared in the for, whereas the functions in the button will access the (Global) variables.

Simple remedy: remove the variables defined in the form, and leave those (Globals).

You should do a similar thing with FinalizeRow and InitializeRow: put only one function in the Globals section, so they will be visible for all other functions. And remove those local functions.

Off to dreamland...
0
 
Sjef BosmanGroupware ConsultantCommented:
Cool tabs by the way!
0
 
jforget1Author Commented:
Thank you so much for the help, with some help from Chris, have this working now.
0
 
Sjef BosmanGroupware ConsultantCommented:
Great!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 13
  • 11
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now