primefaces: Datatable: Sorting dropdown behaves wrong with unsortable columns

1) Environment

Primefaces 6.1

2) Expected behavior

Datatable sorting works in reflow mode

3) Actual behavior

Datatable in mobile reflow mode. If the first column is not sortable the sort dropdown does not behave correctly. When you click on the last entry another one is selected

4) Steps to reproduce

Execute the project below with mvn jetty:run

primefaces-test-datatable-sort-reflow.zip

5) Sample XHTML

…just the showcase sort demo with reflow and the first column unsortable.

<p:dataTable var="car" value="#{dtSortView.cars1}" reflow="true"
                    >
         <f:facet name="header">
             Single Column Sort
         </f:facet>

         <p:column headerText="Id" sortable="false" >
             <h:outputText value="#{car.id}" />
         </p:column>

         <p:column headerText="Id2" sortBy="#{car.id}" sortable="true" >
             <h:outputText value="#{car.id}" />
         </p:column>

         <p:column headerText="Year" sortBy="#{car.year}" sortable="true">
             <h:outputText value="#{car.year}" />
         </p:column>

         <p:column headerText="Brand" sortBy="#{car.brand}" sortable="true">
             <h:outputText value="#{car.brand}" />
         </p:column>

         <p:column headerText="Color" sortBy="#{car.color}" sortable="true">
             <h:outputText value="#{car.color}" />
         </p:column>
     </p:dataTable>

6) Sample bean

see 4.)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Interesting refactoring let me try that.