October 4, 2010

XPages: Edit multi-value fields in existing documents - A frustrating battle!

It's been a while since I last wrote something on here, I'm blaming it on a very busy schedule, but now there's something I would very much like to share with the rest of the XPages Community: During the last couple of months, I've been (amongst other things) working on implementing an "edit news article"/"edit user profile" feature on website I'm creating. I've previously developed a "create news article". This XPage contains the usual "heading", "lead paragraph" and "body" fields, but also some multi-value fields to select category and target audience for the news article.

The creation of these multi-value fields were fairly straight-forward, and creating news articles worked like a dream. However, trying to edit these fields on an XPage was to be a more painful experience. Changing the values and hitting the save button on the site would not have the desired effects on the saved Notes document, the multi-value fields would remain unchanged. The whole thing was getting very frustrating, but fortunately there are some explaining and helpful articles out there on the web:


  • Sean Cull has created a page that demonstrates the the differences between a field's value and submitted value. Take a look here.
  • IBM have written something themselves about the topic, have a look here.
  • YouAtNotes.de writing about getting and setting field values and value bindings here.
I hope these links will prove to be as helpful to some of you as they were to me!

5 comments:

  1. Here is something that will help as well : http://www.recondite2.com/ReconditeBlog.nsf/dx/xpages-multi-line-edit-box

    ReplyDelete
  2. Hmm, can't get your link to work...getting a timeout error.

    ReplyDelete
  3. If you use a custom converter, it's quite easy to work with multi value fields.

    Maybe this code snippet can be of use for you:
    http://dontpanic82.blogspot.com/2010/06/xpages-code-snippet-for-multi-value.html

    ReplyDelete
  4. @Tommy: Thanks for the link, looks interesting. I will try to implement something similar, hopefully it will suit my needs! :-)

    ReplyDelete
  5. Very useful and meaning post,Help me think of a lot of useful thing.Alway visit your blog and support you.

    ReplyDelete