2
votes

Is there a simple way to copy the value from an inputText to a field inside a Xpage ( document content ) from other application via a <xp:link>?

I know how to redirect the user to the respective URL, but how can I pass the value for the receiver xpage / field ?

2

2 Answers

2
votes

Just add a parameter to URL like ?value=theValue.

In target XPages you can access the parameter with param.value in SSJS code.

2
votes

You'll need a two-stage process: 1) pass it to somewhere the other page can retrieve it from. 2) Retrieve it when the other page loads and put it into the inputText.

Using server-side code (SSJS, Java) you can't pass a value for retrieval outside the current NSF unless you take advantage of an OSGi plugin (aka extension library). Each NSF is its own JSF application and is not aware of any other. Something like the OpenNTF Domino API has the concept of a serverScope, which would allow it to be stored there.

If your NSF doesn't use an extension library that provides a server scoped map, the only option is to pass it in URL parameters (encoding the value accordingly). The receiving page will then need to retrieve the value from the URL parameter on page load, decode the value and put it in the inputText. That can either be done with getComponent("inputText1").setValue() or, better practice, put into the datasource it's bound to, e.g. if the inputText is bound to the value #{document1.field1} then use document1.replaceItemValue("field1", myParamValue)