XPages ApplicationLayout: how to control TitleBar tabs from a view

262 views Asked by At

I am using the Application Layout for an application we are creating. We would like to controls the tabs that appear on the title bar. The tabs are defined in a document, with a french title, english title and NotesID of what will be the default document shown for that tab.

With so many controls available, what would be the best way to achieve that? What kind of control can I use to add to the TitleBar that would end up doing the functionality I am looking for?

One additional thing: I need to add a few drop downs, ideally in the titlebar as well, that will set some values used to control what is displayed in the tabs contents and to control what the search will actually search for (language, province, department). What would be the best approach adding thse drop downs to the titlebar?

And by the way, where do you guys get all that information? I have TLCC's courses, IBM's XPages books (that I have not read from cover to cover, I admit) and I still find it very hard to things more advanced than displaying a view and do come CRUD with documents. There are so many containers that can contain a wide variety of objects... Pretty confusing right now what needs to be in what in order to make this all work together.

Thanks a lot, Ben

1

There are 1 answers

1
Knut Herrmann On BEST ANSWER

Use xe:repeatTreeNode to create several tabs programmatically in title bar:

  • create an array of objects with label and unid (UniversalID) from your document in value
  • define a variable tab for repeat
  • define a xe:basicLeafNode as children with a label tab.label and a href link with tab.unid
   <xe:this.titleBarTabs>
       <xe:repeatTreeNode
            indexVar="aaa"
            value="#{javascript: 
                [  {label:'aaa',unid:'...id..aaa...'},
                   {label:'bbb',unid:'...id..bbb...'},
                   {label:'ccc',unid:'...id..ccc...'}
                ]}"
            var="tab">
            <xe:this.children>
                <xe:basicLeafNode label="#{tab.label}">
                    <xe:this.href><![CDATA[#{javascript:
                       "yourXpages.xsp?action=openDocument&documentId=" + tab.unid;
                       }]]></xe:this.href>
                 </xe:basicLeafNode>
            </xe:this.children>
        </xe:repeatTreeNode>
   </xe:this.titleBarTabs>

This will show the labels in title bar and open the assigned document clicking on them.