Thomas Adrian
Thomas Adrian

Reputation: 3636

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

Upvotes: 0

Views: 781

Answers (1)

Oliver Busse
Oliver Busse

Reputation: 3395

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

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

Upvotes: 3

Related Questions