I have been learning Xpages programming. We are currently using domino 8.5.2. I am gaining familiarity with the display/input controls and I have had some success using them to display information from backend domino documents, views, scoped variables that are not an array. What I have not been able to discover is how to display the elements of a scoped variable array that is created dynamically.
For instance: I create an array with a number of elements. I can print the elements to the domino log with the following code:
for (var i=0; i<array.length; i++) {
print(array[i])
}
What do I use to display the individual elements on webpage? I apologize if the answer if obvious. I did find one posting about displaying a 2 dimensional array - but was unable to interpret the answer.
Thanks for any guidance.
---Lisa&
Use a repeat control and show elements within repeat in a computed field:
<xp:this.beforePageLoad><![CDATA[#{javascript:
var myTest = [];
for (var i=0; i<9; i++) {
myTest[i] = i;
}
viewScope.myTest = myTest;
}]]></xp:this.beforePageLoad>
<xp:repeat
id="repeat1"
rows="30"
var="row"
value="#{viewScope.myTest}">
<xp:text
escape="true"
id="computedField1"
value="#{javascript:row.toString()}">
</xp:text>
<br />
</xp:repeat>
The array is in viewScope.myTest in this example.