0
votes

I have an xPages form editing a document, which can be edited automatically (as a datasource) coming frme a view. But you can also input directly (in an input field) the key of the document; then (if it exists) it will be searched in the database (converting the key in an UNID). The matter is that in this case it is not the currentDocument and custom controls tests (for example for displaying buttons) do not work.

So my question is how to "convert" a programmatically searched document in the database (by UNID) to the normal datasource currentDocument, so normal controls can be apply to it too ?

Thanks if you know.

2

2 Answers

1
votes

Store the Unid in the session and compute the data source from there - or open the Form with the matching URL parameter

0
votes

Your problem is in the URL: it does not contains params to initialize default data source. This is IMHO the simplest way to fix it: native Domino links and XPages.

I am not sure whether it will help, it depends on actual value of context.getUrl(). If it doesn't, you need to redirect to URL you compute from UNID, as Stephan suggested.