Open Document With 'Whatever' XPage
I have an application where users will normally page through documents. Find a starting point, open that document, then go "Next Document" to open the next one instead of jumping back to the view. Computing the previous and next document UNID's is pretty easy - find the current document in the view, then find the previous or next document in the view and return its UNID. For the "previous" and "next" links on the XPage, I can use the Simple Action "Open Page". This lists the current XPages in the application and also "previous page" and "launch page". But if my view contains documents with multiple different forms, then I might not have one fixed XPage that I'll be opening. I could (since I already have the document UNID) look up the document and inspect its "Form" field and compute the XPage to open based on that, but there's an easier way. Assuming each form has the "display XPage instead" property enabled, then I can just tell Domino to open with "whatever XPage is supposed to be used for that form" through a "special" XPage.
The name of the XPage to open is "$$OpenDominoDocument.xsp". Here's the XPage source for the link:
<xp:link escape="true" text="Previous" id="link1">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:openPage target="openDocument" documentId="#{javascript:return prevUNID}">
<xp:this.name><![CDATA[#{javascript:return "$$OpenDominoDocument.xsp";}]]></xp:this.name>
</xp:openPage>
</xp:this.action>
</xp:eventHandler>
</xp:link>