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 6, 2018, 8:08 PM
13 Posts

How to sort repeat control view columns

  • Category: Custom JSF code (Eclipse IDE)
  • Platform: Windows
  • Release: All
  • Role: Developer
  • Tags:
  • Replies: 2

Hi All,

I am using a repeat control view for my xpage and not sure how to put sorting options for every column like regular view control column headers. Please guide me. I designed just two columns but there will be 8 columns.

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">

    <xp:this.data>
        <xp:dominoView var="view1" viewName="Reserved"></xp:dominoView>
    </xp:this.data>
    
        <xp:table >
        <xp:tr>
            <xp:td>name</xp:td>
            <xp:td>type</xp:td>
        </xp:tr>
        <xp:repeat id="repeat1" rows="30" value="#{view1}"
            var="rowData" indexVar="rowIndex">
            <xp:tr>
                <xp:td>
                    <xp:text escape="true" id="computedField1"
                        value="#{rowData.Model}">
                    </xp:text>
                </xp:td>
                <xp:td>
                    <xp:text escape="true" id="computedField2"
                        value="#{rowData.Type}">
                    </xp:text>
                </xp:td>
            </xp:tr>
        </xp:repeat>
    </xp:table>  
    </xp:view>

Jun 7, 2018, 2:06 PM
298 Posts
That is up to you...
The repeat does not have sorting, it displays the data in whatever order your data is in.

So, you would have to develop your own sorting that will sort the data and redisplay the repeat control. Typically I get the data for the repeat via code and send an ArrayList of objects to the repeat (not a view). I suspect you would have to do that.


Howard

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