Bitwyse1
Bitwyse1

Reputation: 339

Trying to open another xPage from a basicContainerNode

I have a navigation custom control that I want to link to specific documents in a database. I tried using a pageTreeNode but that opened the link when the page loaded. I was told to use a basicContainerNode which allows me to execute code to build the URL but I don't know the code to open the xPage. Can someone tell me how to open the xPage once I have a URL to a document?

<xp:eventHandler event="onItemClick" submit="true"
        refreshMode="partial" refreshId="navigator1">
        <xp:this.action><![CDATA[#{javascript:
        if( context.getSubmittedValue() == "ArchitecturalChangeForm" )
        {
            //  Open Page with queryString
            var docUNID = eStarService.fetchDocLibraryDocumentUNID( sessionScope.get( "PropertyNox" ), "Architectural Change Form" );
            if( isEmpty( docUNID ) )
            {
                sessionScope.put( "dialogOopsTitle", "Oopps!" );
                sessionScope.put( "dialogOopsMessage", "\nUn-able to locate Architecture File!  Please review My reference Library!" );
                var dialogOops = getComponent( "dialogOops" );
                dialogOops.show();
                return "";
            }
                            //  WHAT GOES HERE FOR THE URL??
            return "OpenDocument&docunid=" + docUNID;
        }

Upvotes: 0

Views: 212

Answers (1)

Per Henrik Lausten
Per Henrik Lausten

Reputation: 21709

You can use context.redirectToPage():

context.redirectToPage( "yourxpage.xsp?action=openDocument&docunid=" +  docUNID);

Upvotes: 2

Related Questions