I have a doc in a database that displays in XPages. This doc contains a list of DocIDs of documents I’d like the user to be able to link to, so I’d like to build working doclinks in the display XPage.
I’ve been searching and tried several options but I haven’t gotten it to work yet. So what’s the code in an XPage to display a working doclink icon the XPage when all I have to start with is the target doc’s DocID?
You’ll need a couple of things. One is an icon for your doclink, which you can get rfrom a variety of sources.
If you’re displaying a view or a form via an XPage, they don’t need to be visible to the web for your DominoDocument or DominoView control to use them. However, if you’re creating a link opening a document via a URL, the view will need to be available to the web. So if you have a default view that’s available to the web, it should work if you create an image control or a link control. Alternatively, in the source panel you can enter HTML.
Ah, I got it figured out. I created an image in the database and pasted it in the appropriate place in my XPage, and added the following Open Document code:
LinkID_X is the field that contains the appropriate link for the target document and View is sorted by that field. DOCID_FIELD contains the actual DOcument ID the Open DOcument code needs.
Thanks for the quick reply. This is a great idea but if I’m using a computed field where would I enter the HTML? In the Value section my options are Simple Binding, Javascript (which I think I want) and Advanced. How would I put pass-through HTML in the Javascript pane?
But it sounds like you mean something else with the Source pane - do you mean adding an image and a document open event? Or do you mean some other way of creating a working link on the fly?