XPages Tip: Work with multi value fields

In classic notes dev you can make a variety of fields multi value fields and define how values are to be separated. Imagine you have such a notes form and want to put an xpages frontend on top of it. How do you separate multi values?

Ok, it’s easy, isn’t it. Just use a Multiline Editbox control, bind that to your multi value field on the form and put a new value in every line of the box, right? This only works halfway since the contents of the field are being saved as a text string with hidden chars to get the line breaks. To separate the values you have to tell the Multivalue Editbox how to do it. Open the „All Properties“ Tab of the control and in the basic section navigate to the „multipleSeparator“ property as shown in the screenshot below. Compute a javascript value using the little blue diamond end enter „\n“ (with quotation marks). Save the XPages. Now your values get saved as multiple values.