0
votes

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

1
Out of interest, why the preference for client-side? (I'm not saying there's not one, just trying to understand the use case, for my own future use.) As far as I'm aware you will need to interact with the server to change the datasource's edit mode, otherwise values will not be applied after the next submission. So using partial refresh (and potentially partial execution) will perform slightly better on the server, potentially pass back less HTML and avoid reloading the page into memory.Paul Stephen Withers
I previoulsy used a simple action to change the data source mode to edit mode, but that did not change the url. So instead of writing the whole story and with a risk of getting a complicated backend solution I went for asking for something easier.Thomas Adrian

1 Answers

3
votes

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

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