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