This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Sep 5, 2011, 1:44 PM
66 Posts

ComputedField and multiple values

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role:
  • Tags:
  • Replies: 4
 I have a  Comuted Field on my xPage and I need to display field, which holds multiple values. Aa a default Computed Field uses comma as multiple value delimiter. I need a new line instead. Is there a way how to adjust it?
Sep 5, 2011, 4:04 PM
170 Posts
Re: ComputedField and multiple values
Try this code
 
@Implode(@GetField("YOURFIELDNAME"),@NewLine()) 
 
/Fredrik 
Sep 6, 2011, 6:08 PM
25 Posts
Re: ComputedField and multiple values
that doesn't work for me. Just displays all the information on one line..
 
I tried the repeat control as well.. no joy
Sep 7, 2011, 11:13 AM
272 Posts
Re: ComputedField and multiple values
Hi,
 
what about this?
 
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:text escape="false" id="computedField1">
        <xp:this.value><![CDATA[#{javascript:var data = @Explode("A,B,C",",");@Implode(data,"<br>") }]]></xp:this.value>
    </xp:text>
</xp:view>
 
Sven
 
[The only reason for the @Explode is to have multiple values]
Sep 16, 2011, 8:54 PM
5 Posts
Re: ComputedField and multiple values
Hi,
 
You will need to the change the content type of the <computed field> to HTML and then use the following formula into the SSJS: (remember '</br>' is required for it to work)
 
var data = @Explode("Weekly;Status;Report",";");

return @Implode(data,"<br></br>")

 Hope this helps.
Regards 
 
Neeraj 

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal