Dynamatic external URLs in XPages
Jul 29, 2011

One of the few things you can set programmatically in Xpages is the URL target of a Link custom control. And sure enough, I have a need to just that. I've been working on a little app for a friend of mine that is like a list of bookmarks, with some categorization, tags, and searching. I wanted to have a view (or data table or whatever) with the links displayed and when you click it it just takes you to that site in a new window/tab. One little bits missing: the diamond next to the link URL:

The annoying part is that you can do this in "old" Notes in a view by putting in some HTML. So I did that, I put this into a column of each view:

 "<A HREF=\"" + "http://"  + linkURL + "\" target=\"_blank\">" + linkURL + "</A>"
 then created view controls of each. It works. I had experimented around trying to put in a value in the link, but xPages didn't like anything I did. But this method works. There may be a more xPage-centric way, and I'd love to do it, but I get to roll this out. I did some searching and didn't find anything like this, so I'm posting.


Add a Comment 
More Actions 
Comments (3)

1 Ulrich Krause commented July 30 2011 Permalink Recommendations 0
>> One little bits missing: the diamond next to the link URL


Are you sure? I can click the diamond and fill in some js to calculate the link.

2 Dave Lemaster commented July 30 2011 Permalink Recommendations 0
I've used a computed fields in repeat controls instead of the link controls. Set the content type to HTML.


var doc:NotesDocument = vEntries; 
var docURL = doc.getHttpURL(); 
var docDESC = doc.getItemValueString("IDescription"); 

3 Paul Withers commented July 30 2011 Permalink Recommendations 0
If I remember correctly from the managed beta, the diamond was removed for 8.5.2 because the type can be more than just URL. Is the diamond visible in the All Properties pane?
This is an archive of my previous blog http://www.bleedyellow.com/blogs/DominoHerald attachments are in the download control