Wednesday, September 12, 2007

Portletize Lotus Notes Application - Part 2 (Multi-value separator)

Lotus Notes field allow us to set it to mutiple values. It can be set to take one or more separator values (space, comma, semicolon, new line and or blank line).

What happen when a field on the portal is map to a multiple value field in Notes? If we set comma is separator, even if the value in the portal contains a comma, it will be stored as a single value (eg "one, two") and not multi value (eg "one", "two").

Portlet Factory by default uses "|" as the separator which Notes does not support. After a few failed attempt to convert the separator, I manage to use an agent to do the job. In the Domino View & Form builder, there is an option "Run agent on save". This would call the agent to process the field before saving.

I know this is just a work around and there is a more efficient way to do it. At the Portlet Factory - Lotus Collaboration Forum, Sam have helped to answer the questions.



An Event Handler builder can be used. In the Event Name, select System:OnWebAppLoad. Then in the Actions, select the method setItemValueSeparator from your view. Set it to comma. This should automatically convert the field into a comma separated multi-value. At the moment, it does not support multiple separator (according to Sam in the forum). It would be useful if in the future version to support that and also as like in Notes, we can set which separator to use for display. Hoping to see the features in the future release.

Add to del.icio.us

1 comment:

Anpy said...

Good experimental..!!!