0
votes

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>
3
Seems like your url for the link gets calculated wrong. The XPage1.xsp# will always just reloud your Xpage1. How do you create the url for this link? Could you please add the Code of your repeatControl and your link?Michael Saiz
Out of curiosity, why are you putting your content inside <xp:scriptBlock>? From your code it seems you are using it for hide/when.Naveen

3 Answers

0
votes

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="".

0
votes

You need to set the URL of the link this way:

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

    ... complex values to display...

</xp:link>
0
votes

Try the below code.

<xp:repeat id="contactRepeat" rows="30" 
value="#{MForApproval}" var="FA_Row" disableOutputTag="true">
    <xp:panel tagName="li" rendered="#{javascript:FA_Row.isCategory()}">
        <xp:this.attrs>
            <xp:attr name="data-role" value="list-divider" />
            <xp:attr name="data-dividertheme" value="b" />
        </xp:this.attrs>
        <xp:text tagName="h3" disableTheme="true" value="#{FA_Row.categoryCol}" />
    </xp:panel>
    <xp:panel tagName="li" rendered="#{javascript:FA_Row.isDocument()}">
        <a href="Xpage1.xsp?documentId=#{javascript:FA_Row.getUniversalID()}">
            <xp:text value="#{FA_Row.ColName}" disableTheme="true" />
        </a>
    </xp:panel>
</xp:repeat>

You just need to update column names inside <xp:text> tag.