Search code examples
xpagesdatasourceellotus-dominodomino-designer-eclipse

How to change url parameter openDocument to EditDocument from a client side link in XPages


I have a data source called "doc" and a link control on my xpage. The datasource is bound to a document using the url parameter

documentId=914A....&action=openDocument

When I click the link control I want to change the url parameter action to "editDocument" so that my data source goes into edit mode.

I would like this to be a client side solution, so I am thinking it can be done by constructing the url using EL, so something like this.

<xp:link escape="true" text="Edit Mode" id="link5" value="/documentID=#{doc.getUniversalID...}?action=editDocument"></xp:link>

any ideas?

Thanks Thomas


Solution

  • What about simply changing the location.href by replacing "openDocument" with "editDocument"?

    location.href = location.href.replace(\openDocument\g, "editdocument");