2

Please refer to this question to get an idea of what I'm trying to do. The only exception is I'm using an ApplicationLayout and I want the toolbar underneath the PlaceBar. Is there a way to trick CSS to show the toolbar underneath the PlaceBar, then when scrolling, keep it at the top of the page? Or, how about fixing the top parts of the ApplicationLayout (i.e. PlaceBar, TitleBar, etc...), so that they don't scroll either?

Community
  • 1
  • 1

1 Answers1

4

Update: Extended this idea to make XSnippet. Download it from here.

To fix the top parts of Application Layout like place bar, title bar you will have to look into the CSS of the HTML page generated by application layout control (Google Chrome has a greate feature of Inspect Element for that). It uses classes like lotusTitleBar, lotusPlaceBar, lotusContent and so on, which you can use in your custom CSS to create your floating toolbar.

So let's say if this is your XPage with application layout control from extension lib.

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" xmlns:xe="http://www.ibm.com/xsp/coreex">
    <xp:this.resources>
        <xp:styleSheet href="/cssAppLayoutFloatingMenu.css"></xp:styleSheet>
    </xp:this.resources>
    <xe:applicationLayout id="applicationLayout1">
        <xp:panel>
            Sample Text. 1
            <xp:br></xp:br>
            Sample Text. 2
            <xp:br></xp:br>
            Sample Text. 3
            <xp:br></xp:br>
            Sample Text. 4
        </xp:panel>
        <xe:this.configuration>
            <xe:oneuiApplication titleBarName="Sample Title" placeBarName="Sample Place">
                <xe:this.footerLinks>
                    <xe:basicContainerNode label="Container 1">
                        <xe:this.children>
                            <xe:basicLeafNode label="Link 1" href="/"></xe:basicLeafNode>
                            <xe:basicLeafNode label="Link 2" href="/"></xe:basicLeafNode>
                        </xe:this.children>
                    </xe:basicContainerNode>
                    <xe:basicContainerNode label="Container 2">
                        <xe:this.children>
                            <xe:basicLeafNode label="Link 1" href="/"></xe:basicLeafNode>
                            <xe:basicLeafNode label="Link 2" href="/"></xe:basicLeafNode>
                        </xe:this.children>
                    </xe:basicContainerNode>
                </xe:this.footerLinks>
                <xe:this.placeBarActions>
                    <xe:pageTreeNode label="Page 1"></xe:pageTreeNode>
                    <xe:pageTreeNode label="Page 2"></xe:pageTreeNode>
                </xe:this.placeBarActions>
            </xe:oneuiApplication>
        </xe:this.configuration>
    </xe:applicationLayout>
</xp:view>

You can use this CSS to make the title bar and place bar float

.lotusTitleBar {
    /*Class for Title bar*/
    position: fixed;
    width: 100%;
    height: 45px;
    z-index: 100;
}
.lotusPlaceBar {
    /*Class for Place bar*/
    position: fixed;
    width: 100%;
    z-index: 100;
    top: 45px; /*Start after height of lotusTitleBar*/
    height: 35px;
}
.lotusContent {
    /*Class for Content*/
    position: relative;
    top: 80px; /*Height of lotusTitleBar + Height of lotusPlaceBar*/
}

NOTE: This is a very basic example with only title bar and place bar. If you include banner or other elements in application layout you would have to modify accordingly.

Naveen
  • 6,786
  • 10
  • 37
  • 85