Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-1129

Sorting problem for boolean type property in browse view (JSF)


    • Type: Service Pack Request
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 2.2.6
    • Fix Version/s: 2.2.8
    • Component/s: Alfresco Explorer
    • Labels:
    • Environment:
    • Bug Priority:
      Category 2
    • ACT Numbers:


    • Testcase ID:




      Strange behaviour with sorting a boolean column in list view in JSF - this could be a configuration issue or a bug with JSF.

      When configuring the list view in JSF to include a boolean property and trying to sort by this boolean value it is observed that you have to click twice on the column header for the sorting to work. Initial sort -order seems to work OK on the boolean column but clicking on the header to change the sort order makes the order appear random, clicking on the header column again re-sorts correctly.
      This problem has been reported by a customer and since replicated in-house.

      Set up a rudimentary repro by altering the existent contentModel and adding a High Priority property to the cm:auditable aspect, this is set as follows following the d:boolean data type:
      <property name="cm:highpriority">
      <title>High Priority</title>
      <index enabled="true">
      Altering the web-client-config-custom.xml allows the boolean value to set in the GUI when adding/modifying conent.

      Next I altered the browse.jsp to include the High Priority column for content listings, see below:

      <%-- Urgent column for custom view modes --%>
      <a:column id="colHighPriority" style="text-align:left" rendered="#

      {BrowseBean.browseViewMode == 'details'}

      <f:facet name="header">
      <a:sortLink id="colHighPriority-sort" label="High Priority" value="cm:highpriority" styleClass="header" mode="case-insensitive" />
      <h:outputText id="colHighPriority-txt" value="#

      {r['cm:highpriority'] ? 'Yes' : 'No'}

      " >
      <a:booleanEvaluator value="#


      "></a: booleanEvaluator>

      So far this displays fine, the listings show this additional column.

      Next I edit the content list in the browse.jsp to include the sort definition.

      <a:richList id="contentRichList" binding="#


      " viewMode="#


      " pageSize="#


      styleClass="recordSet" headerStyleClass="recordSetHeader" rowStyleClass="recordSetRow" altRowStyleClass="recordSetRowAlt" width="100%"


      " var="r" initialSortColumn="cm:highpriority" initialSortDescending="true">

      • and inject the RichListRenderer into the Views via the web-client-config-custom.xml:

      <config evaluator="string-compare" condition="Views">
      <!-- the views available in the client -->
      org.alfresco.web.ui.common.renderer.data.RichListRenderer $DetailsViewRenderer
      <!-- default values for the views available in the client -->
      <!-- allowable values: list|details|icons -->
      org.alfresco.web.ui.common.renderer.data.RichListRenderer $ListViewRenderer

      The content listing does appear to initially list correctly by the boolean property column, however if you click the column header to change the order round, the order appears to go random (probably sorting by another order), when you click the column header again it sorts again correctly.

      Steps for replication
      Install 3.1.1e
      Put attached files into the following locations of the clean 3.1.1 instance:
      contentModel.xml - this has been modified slightly to include a boolean apsect for testing. Overwrite the existing contentModel.xml in 'alfresco\WEB-INF\classes\alfresco\model'.
      web-client-config-custom.xml - overwrite the existing web-client-config-custom.xml in 'shared\classes\alfresco\extension'.
      browse.jsp - overwrite the existing browse.jsp in 'webapps\alfresco\jsp\browse'

      Start Alfresco and create a test space.
      In this space add some content, make some high priority and others not.
      Refresh the page with the content listing and it should sort automatically by the column 'High Priority'
      Now click the header 'High Priority', notice that it takes two clicks to re-sort correctly each time.

      Additional Info
      Customer's environment is 2.2.3e, though this problem was observed initially on 2.2.0e
      Reproduced in-house on 3.1.1e
      Problem is not seen on non-boolean properties, these sort correctly on single click.

      None, customer is using a different data type for the sorting (d:date).


        1. browse.jsp
          26 kB
        2. contentModel.xml
          34 kB
        3. web-client-config-custom.xml
          6 kB

          Issue Links




                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  astrachan Alex Strachan
                • Votes:
                  0 Vote for this issue
                  0 Start watching this issue


                  • Created:

                    Structure Helper Panel