Bryan Schmiedeler
Bryan Schmiedeler

Reputation: 3127

Xpages Open new Database in Same Tab/Windows in XPiNC

I am trying to creating uniform application layout for multiple applications.

I cannot seem to get a link on the AppLayout in one database to open a new database in the same tab/window as the first database. My goal is to have aa uniform application layout control for several databases, with a link in the Application Links to each database, so it looks to the user as if they are really in one big application. And I am doing this in XPiNC.

I keep getting opened in a new tab. I have changed the setting for the DB for the default to open in the same window/tab. I have tried 3 different methods to do this, which are below in the code.

I really would love to be able to do this.

<?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:script
            src="/xpCGIVariables.jss"
            clientSide="false">
        </xp:script>
    </xp:this.resources>
    <xp:platformEvent
        id="platformEvent1"></xp:platformEvent>
    <xe:applicationLayout
        id="applicationLayout1">
        <xp:callback
            facetName="facet_1"
            id="callback4" />
        <xp:this.facets>
            <xp:callback
                facetName="MastFoot"
                id="callback6"
                xp:key="MastFooter" />
            <xp:callback
                facetName="RightColum"
                id="callback5"
                xp:key="RightColumn" />
            <xp:callback
                facetName="LeftColumn"
                id="callback3"
                xp:key="LeftColumn" />
            <xp:callback
                facetName="searchBar"
                id="callback2"
                xp:key="SearchBar" />
            <xp:callback
                facetName="MastHeader"
                id="callback1"
                xp:key="MastHeader" />
        </xp:this.facets>
        <xe:this.configuration>
            <xe:oneuiApplication
                navigationPath="#{javascript:compositeData.navigationPath}"
                defaultNavigationPath="home"
                productLogoHeight="50px"
                legal="false"
                productLogo="/smallLogo.png"
                productLogoWidth="50px"
                productLogoStyle="padding-top:5.0px;padding-bottom:5.0px"
                placeBarName="PC Checklist"
                titleBarName="PC Checklist"
                placeBar="false"
                footer="false">
                <xe:this.footerLinks>
                    <xe:basicContainerNode label="Container 1"></xe:basicContainerNode>
                </xe:this.footerLinks>
                <xe:this.titleBarTabs>
                    <xe:pageTreeNode
                        label="PC Tasks"
                        selection="/PCTasks/.*"
                        page="/xpViewAllPCTasks.xsp" />
                    <xe:pageTreeNode
                        label="PC Builds"
                        selection="/PCBuilds/.*"
                        page="/xpViewAllPCBuilds.xsp" />
                </xe:this.titleBarTabs>
                <xe:this.placeBarActions></xe:this.placeBarActions>
                <xe:this.bannerUtilityLinks>
                    <xe:basicLeafNode label="My Email">
                        <xe:this.href><![CDATA[#{javascript:var url = "Notes:///0000000000000E00/"
url}]]></xe:this.href>
                    </xe:basicLeafNode>
                    <xe:separatorTreeNode loaded="true"></xe:separatorTreeNode>
                    <xe:basicLeafNode>
                        <xe:this.label><![CDATA[#{javascript:"Welcome " + @Name("[CN]",session.getEffectiveUserName());}]]></xe:this.label>
                    </xe:basicLeafNode>
                </xe:this.bannerUtilityLinks>
                <xe:this.bannerApplicationLinks>
                    <xe:basicLeafNode
                        label="The Scoular Company"
                        style="height:50px"
                        styleClass="lotusText">
                        <xe:this.onClick><![CDATA[window.open("http://www.scoular.com","_self")]]></xe:this.onClick>
                    </xe:basicLeafNode>
                    <xe:basicLeafNode
                        label="PC Checklist"
                        selected="true">
                        <xe:this.href><![CDATA[#{javascript:if (database.getTitle() != "PC Checklist")
{var url = "notes://KC1/PCCheckList.nsf/xpHome.xsp?OpenXpage";
url;}}]]></xe:this.href>
                    </xe:basicLeafNode>
                    <xe:basicLeafNode label="CompuWeigh Monitor">
                        <xe:this.href><![CDATA[#{javascript:var url = "notes://<SERVER>/compuweigh.nsf/xpHome.xsp?OpenXpage"
url}]]></xe:this.href>
                    </xe:basicLeafNode>
                    <xe:basicLeafNode label="CompuWeigh Monitor">
                        <xe:this.onClick><![CDATA[var url = "notes://<SERVER>/compuweigh.nsf/xpHome.xsp?OpenXpage";
window.open(url,"_self")]]></xe:this.onClick>
                    </xe:basicLeafNode>
                    <xe:basicLeafNode label="ComputWeigh Monitor">
                        <xe:this.onClick><![CDATA[window.open("notes://KC1/compuweigh.nsf?OpenDatabase","_self")]]></xe:this.onClick>
                    </xe:basicLeafNode>
                </xe:this.bannerApplicationLinks>
            </xe:oneuiApplication>
        </xe:this.configuration>
    </xe:applicationLayout>
    </xp:view>

Upvotes: 1

Views: 165

Answers (1)

Knut Herrmann
Knut Herrmann

Reputation: 30960

I would create an additional database which contains the XPages code from all databases and uses the current Notes databases as data containers only.

This way you have all navigation and all XPages code at one place. And your code is separated from data which is always good.

You would add a configuration document into your additional XPages database which contains the paths to the data container databases. Use those paths in XPages's data sources definitions.

Upvotes: 2

Related Questions