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



Jun 1, 2011, 3:03 PM
16 Posts
topic has been resolvedResolved

Repeat Control Madness

  • Category: Server Side JavaScript
  • Platform: All
  • Release: 8.5.2
  • Role: Developer
  • Tags: Repeat
  • Replies: 1
 ok,
I have a Xpage where I have a viewScope variable called extracost setup as a vector 
 
var extra = new java.util.ArrayList();
viewScope.put("extra",extra);

var extracost = new java.util.ArrayList();
viewScope.put("extracost",extracost);
 
I have the users selecting accessories from a repeat control adding or removing to this control.  (Excellent video from David Leedy here) 
 
I then on save write this back to the document using 
 
 Doc.replaceItemValue("accessorycost",@Explode(@Trim(viewScope.extracost),",",0))
 
Finally I have Lotusscript convent these values to numbers vs a text list 
 
ReDim AccessoriesNum (0 To UBound(doc.accessorycost))
For i=0 To UBound(doc.accessorycost)
AccessoriesNum(i)=Val(doc.accessorycost(i))
Next
So the values can be totaled. 
 
I then on a panel in the form reference this later in a repeat control. 
 
All works great if the users selects more than one entry. 
 
If they choose one for example with a cost of 30 dollars the repeat control displays this (after conversion looks okay as text array) as 
$0.00 
$1.00 
$2.00 ..... 
$29.00 
 
I have tried using the following
var r = document1.getDocument().getItemValueDouble("accessorycost")
return (r.constructor == Array) ? r : [ r ];
 
and this works on the single values so that 30 shows as $30 as a single entry.  Problem is it then breaks the multiple entries so only the first one displays. 
 
Any ideas what I am doing work here.  No hair left on my head :) 
 
Thanks for any response 
 
Jun 1, 2011, 4:46 PM
16 Posts
Re: Repeat Control Madness
 document1.getDocument().getItemValue() vs getItemValueDouble or getItemValueString

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