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 13, 2012, 4:11 PM
15 Posts

Use of Repeat Control in xpages...

  • Category: Other
  • Platform: Windows
  • Release: 8.5.2
  • Role: Developer
  • Tags:
  • Replies: 1
As a fresher in xpages i want the detail about how to use repeat control? purpose for using repeat control?
Jun 14, 2012, 9:03 AM
126 Posts
Re: Use of Repeat Control in xpages...
A repeat control can be used to display the contents of a collection similar to a viewPanel or dataView, however it is a lot more customizable as you can place whatever you want in side. It also just takes an array to specify how many
elements it will display so it can be used for other purposes also.
 
e.g. This will render 5 labels on the webpage with the text "Test"
 
<xp:repeat value="new Array(5)"> 
    <xp:label value="test"></xp:label>
</xp:repeat> 
 
e.g.  where subteamArray is an array of strings the below will use the repeat variable "rowData" to pull out each item of the array and display it in a label
 
<xp:repeat value="subteamArray" var="rowData"> 
    <xp:label value="rowData"></xp:label>
</xp:repeat> 
 
You can put any control you like inside the repeat and it will display X number of those where X is the length of the array / collection passed into the value attribute. The Discussion template uses one of these in the "viewTopic" custom control to display a list of replies to a document. It would be helpful to you to view this code to see how it works

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