FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



Jun 6, 2018, 4: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, 10:06 AM
300 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
Jun 9, 2018, 3:06 PM
13 Posts
Thanks

Thanks Howard !!


FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.