XPages - Sorting a filtered view

喜你入骨 提交于 2019-12-11 02:17:21

问题


I have a DominoView data source on my XPage that is filtered using a URL parameter so that only documents matching this parm are displayed.

The filtered documents then need to be sorted by the value of the second column (a status field). What would be the best approach to this?

The XPage is using jQuery Mobile for presentation and the documents would, ideally, be presented in a collapsible list with a separate collapsible for each status value.

Thanks for any tips.


回答1:


The easiest one is to have that view sorted in the second column too. No extra code required. You can have multiple sorted columns which don't need to be adjacent. Then you can have better filter keys. E.g you have 4 sorted columns: you use an array with 1-4 elements as filter. With 1 element it filters on the first column. With 2 elements it filters on the first and second column etc. The results are returned sorted by the remaining sorted columns




回答2:


Not sure if this will help your situation, but I was building a repeat with a view datasource that I needed to search based on a user's value I had stored in the sessionScope. When performing the search, I lost the default sort I had in the view. By adding sortColumn and sortOrder, I got the result I was looking for.

Here's a sample of the source;

    <xp:this.data>
    <xp:dominoView
        var="aprofiles"
        viewName="embAssessmentProfiles"
        sortOrder="ascending"
        sortColumn="apName">
        <xp:this.search><![CDATA[#{javascript:compositeData.searchFilter;}]]></xp:this.search>
    </xp:dominoView>
</xp:this.data>


来源:https://stackoverflow.com/questions/12952598/xpages-sorting-a-filtered-view

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!