All blog posts, code samples and downloads licensed under Apache License 2.0.

Extension Library Namepicker issue - finally worked-around

Oliver Busse on 02/26/2014 10:11:31 PM CET, filed under XSP Java 

I encountered a problem using the Extlib's namepicker bound to readers and authors fields: the names you pick are stored in abbreviated manner into the field. The result is that those fields are stored in the document but theyx have no impact. Even if you have those names in the fields one can not see (or edit) those documents as the values are inappropiate.

As long as the namepicker is not able to be configured in how to store the values in the corresponding field you may have a look at my solution.

I coded a managed bean with one method to be called in the postSaveDocument event of your datasource on your XPage.

package org.openntf.filesilo;
import java.util.Vector;
import lotus.domino.Document;
import lotus.domino.Session;

public class RightsManagement implements Serializable {
	private static final long serialVersionUID = 8157811105680678241L;
	public RightsManagement() {
	 * Calculate all name fields to canonical form
	 * @param doc
	public void setNames(Document doc) {
		Session session = ExtLibUtil.getCurrentSession();
		Vector names = null;
		// item names as array
		String items[] = { "fileAdmin", "fileReaders", "fileAuthors" };
		try {
			for (String item : items) {
				names = session.evaluate("@Name([Canonicalize]; " + item + ")", doc);
				doc.replaceItemValue(item, names);

		} catch (Exception e) {

<!-- faces-config -->

<!-- usage on your XPage -->
	<![CDATA[#{javascript:// canonicalize

As the bean is view-scoped you don't have to bother to recycle the document object.

Tagged with xpages extlib bug domino access