Search code examples
xpageslotus-domino

Xpages viewPanel column looses sorting link after category filter reset


I have a Xpages page with a viewPanel control definied. It it filtered by category and contains some columns. One of them is sortable. Unfortunatelly it looses sorting capabilty in the following scenario:

  1. Open Xpage (filter category: null) - I may click the sort column
  2. Change filter category (filter category: 'something') - The sorting is unavailable (and that's ok thus datasource)
  3. Change filter category back (filter category == null) - The sorting is unavailable, there is no column sorting link (sorting arrows are visible) .

I've tried partial and full refresh but it does not work. What should I do in order to have sorting enabled again?


EDIT

Here is sample code:

<xp:button value="All companies" id="button5">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="partial" refreshId="vpDocuments">
        <xp:this.action><![CDATA[#{javascript:viewScope.cat = null;}]]></xp:this.action>
    </xp:eventHandler>
</xp:button>
<xp:button value="Single Company" id="button2">
    <xp:eventHandler event="onclick" submit="true"
        refreshMode="partial" refreshId="vpDocuments">
        <xp:this.action><![CDATA[#{javascript:viewScope.cat = 'abc';}]]></xp:this.action>
    </xp:eventHandler>
</xp:button>


<xp:viewPanel id="vpDocuments" var="rowData"
    indexVar="rowIdx">
    <xp:this.data>
        <xp:dominoView var="view1"
            databaseName="#{javascript:computeMyDb()}" viewName="xMyView"
            categoryFilter="#{javascript:viewScope.cat}"></xp:dominoView>
    </xp:this.data>
    <xp:viewColumn columnName="$Company" id="viewColumn1">
        <xp:viewColumnHeader value="Company" id="viewColumnHeader1">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="Invoice" id="viewColumn2">                       
        <xp:viewColumnHeader value="Invoice" id="viewColumnHeader2">
        </xp:viewColumnHeader>
    </xp:viewColumn>
    <xp:viewColumn columnName="OrderDate" id="viewColumn7"
        styleClass="dateColumn">
        <xp:viewColumnHeader value="Order Date" id="viewColumnHeader7"
            sortable="true">
        </xp:viewColumnHeader>
    </xp:viewColumn>                    
</xp:viewPanel>

So the last column is sortable, but after clearing category filter the header in not clickable


Solution

  • Please use the keys property instead of the categoryFilter property to fix your issue.