0
votes

I put a Computed Field control on an Xpage. How do I indicate that it has multiple values?

I've looked all day on here and other places and the help files.

If I put "Red", White", "Blue" as the value of that field, it will only display "Blue"

That is the most basic code I can think of...simply a list of text values, but I also tried formulas, etc, which all work if used alone. e.g

getComponent("fld1").getValue(), @UserName, "another value"

2
Please post your code to allow us to check for syntax problems.Tim Tripcony
getComponent("fld1").getValue(), @UserName, "John Smith"m benway
I'll rephrase: please post your code in context... specifically, the entire XML source for the Computed Field component that isn't behaving as you would expect. You can use the curly brace toolbar icon to format the XML as code; otherwise, it would be treated as markup and omitted from display. You may also want to review this checklist to determine whether you'd like to make any additional edits to your question: meta.stackexchange.com/questions/156810/…Tim Tripcony
Sorry, one more item of feedback; the page I linked to above links, in turn, to a blog post that includes this gem: "One trap that many posters fall into is to ask how to achieve some 'small' aim, but never say what the larger aim is. Often the smaller aim is either impossible or rarely a good idea - instead, a different approach is needed. Again, if you provide more context when writing your problem statement, we can suggest better designs."Tim Tripcony

2 Answers

3
votes

There are no multi-value computed controls. Notes items can have multi-values. Classic fields can have a property to join/split the item values. The XPages component behaves more like computed text in classic. So compute into a single String

0
votes

You could use a repeat control to display the multiple values.

<xp:repeat id="repeat1" rows="9999" indexVar="logIndex" var="logLine">
    <xp:this.value><![CDATA[${javascript:document1.getItemValue("FieldName")}]]></xp:this.value>
    <xp:text escape="true" value="#{javascript:logLine}"></xp:text>
    <br/>
</xp:repeat>