Search code examples
urlxpageslotus

Xpage opens URL with hash


I have two Xpages, one containing a repeat control. When clicking on an entry, the second Xpage should open. I am using a link conrol to do this:

<xp:link escape="true" text="" id="link1"
value="/Xpage1.xsp?documentId=#{javascript:FA_Row.getDocument().getUniversalID()}">

... complex values to display...

</xp:link>

The link opens the following URL:

http://www.serverName.de/path/Xpage1.xsp#/path/Xpage2.xsp?documentID=xxx

When the URL is opend in this way, none of my eventhandlers in XPage2 fire. If I open the document manually, using the following URL, everything works fine.

http://www.serverName.de/path/Xpage2.xsp?documentID=xxx

How do I tell my repeat control to open the URL without the "Xpage1.xsp#"?


Here is the complete code of the repeat control, as requested :) It is a categorized view, using jQuery Mobile for formatting.

<xp:repeat id="contactRepeat" rows="30"
    value="#{MForApproval}" var="FA_Row" disableOutputTag="true">

<xp:scriptBlock
    rendered="#{javascript:FA_Row.getNoteID()==''}">
    <li data-role="list-divider" data-dividertheme="b">

        ...Category Text...
    </li>
</xp:scriptBlock>

<xp:scriptBlock 
    rendered="#{javascript:FA_Row.getNoteID()!=''}">

    <li>
        <xp:link escape="true" text="LINK" id="link1"
            value="Button_test_1.xsp?documentId=#{javascript:FA_Row.getDocument().getUniversalID()}">

            ...TEXT...

        </xp:link>

    </li>

</xp:scriptBlock>

</xp:repeat>

Solution

  • I tried your version of the Code and Naveen's. In my example both are working. You could try using a Simple Event or a script event to redirect your User to the other XPage like this:

        <xp:link escape="true" text="linkName" id="link2"
            value="">
        <xp:eventHandler event="onclick" submit="true" refreshMode="complete">
            <xp:this.action>
                <xp:openPage name="xpage1.xsp" target="openDocument">
                    <xp:this.documentId><![CDATA[#{javascript:FA_Row.getDocument().getUniversalID();
    }]]></xp:this.documentId>
                </xp:openPage>
            </xp:this.action>
        </xp:eventHandler>
        </xp:link>
    

    Note: if you using the Event double check that the value="".