Repeat Control array as data source

I want to use an array created by javascript as the data source for a repeat control and then use a computed field inside the repeat control to show the values from the array on the xPage. I have not been able to do it. Here is what I have tried so far.

For the iteration formula for the repeat control I put the code below in the JSS script editor to create the array as the data source

var x = new Array(“test1”,“test2”,“test3”);

x

I put a computed field inside the repeat control with the formula below in the Javascript editor for the field value. The collection name of the repeat control is rowData and the index is rowIndex

rowData(rowIndex).getValue()

Viewing the web page in the notes client I get the error "Error calling method ‘rowData(number)’ on an object of type ‘object [JavaScript Object]’

I realize the formula for the computed field is not right. Sorry for my ignorance but I have looked all over this forum and the web and I am not able to understand what I should do to get the value from the array, thanks for any help.

Background as to why I need an array and can not use a view etc.

Although the data for each row comes from documents in a database the order they have to be displayed on the xPage can not be taken from the order of documents in a view or document collection. For example data for row one of my table on the xPage may come from document one and row two from document two, to get the data for row three I may have to go back to document one again. To solve this part I create my array by getting a document collection and storing all the values from all the documents in an array, then manipulating the array with Javascript to get the array in the order I need to display on the xPage.

Subject: Solved

The Javascript formula for my computed field inside the repeat control needs to be:

getComponent(“repeat1”).getValue()[rowIndex]

repeat1 is the name or ID of my repeat control and as mentioned in the previous post, rowIndex is the what I entered for the repeat control index.

Subject: just use the collection name

Chris,In the computed field, you could just use the collection name (rowData in the example).As the collection is an array of strings, a single element is a single string.