Welcome to the IBM Collaboration Solutions Community IQJam
UsernamePassword
Reset Password | Register
   
Home | Tags | Help
Multi-values in an xPage view panel column 
I have a viewpanel where one of the source columns is a multi-value field with a newline separator

When I bring the data into the viewpanel (Notes client or browser), the xPage view column displays the values separated by a comma

How do I make them display with the newline separator. I've read some stuff about converters but nothing is obvious about how to split the 2 values with a new line

TIA

Mike
Domino Development / XPages
Mike Poole - over 3 years ago |  |  | Viewed 1023 times

There are 2 answers

1votes
Set the content to show as HTML.
 
In the converter: 
getAsObject: return value; 
getAsString: return value.join( '<br/>' );
 
value is a global variable. In getAsObject, it is the submitted value from the browser. In getAsString, it is the "stored" (in memory or on disk) value.
 
getAsObject is used when converting query string values from the browser to the data type you want stored.
 
getAsString is used when converting from stored data to a displayable string.
 
If the data type is a date, or a number, you might want to format it using some sort of converter. I've made simple helper for formatting dates and numbers.
Tommy Valand - over 2 years ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community
0votes

Thanks Tommy, this was the only thing that worked for me.  I found I needed to add a test first to see if the value was an array, otherwise the browser would toss up an error:

<xp:this.getAsString><![CDATA[#{javascript:value.constructor == Array ? value.join('<br/>'): value;}]]></xp:this.getAsString>

Judy Kilpinen - 8 months ago | 
Voting
Vote on the answer to show whether you think the answer is correct or useful to the rest of the community.

Answers with more votes are more visible to the rest of the community

Latest Answers for Domino Development / XPages 

How to call LS agent in xpage
Vijay Kumar - 7 months ago
Multi-values in an xPage view panel column
Judy Kilpinen - 8 months ago
From CSJS refresh a panel dijit.TooltipDialog
daniele grillo - about 1 year ago
How to get value from Repeater Control.
Atul Saxena - about 1 year ago
doing a partial update "beforepageload"
jeroen somhorst - about 1 year ago
How to get value from Repeater Control.
jeroen somhorst - about 1 year ago
How to get value from Repeater Control.
Mervin Thomas - over 2 years ago
Where Would I Delete My Cookie?
Lenni Sauve - over 2 years ago
Query_String value empty with agent URL from xpage
Andy Cunliffe - over 2 years ago
textfield formatting
Ben Poole - over 2 years ago
File Upload/File Download using Managed Beans
Toby Samples - over 2 years ago
File Upload/File Download using Managed Beans
Andy Cunliffe - over 2 years ago