Sorting is not working in datatable in PrimeFaces?

后端 未结 7 2457
感情败类
感情败类 2020-12-15 07:13

Sorting is not working in datatable in PrimeFaces. Please suggest.

See below my .xhtml file



  

        
7条回答
  •  半阙折子戏
    2020-12-15 07:39

    The Problem is:

    
    

    Sorting is done by the at PhaseId.APPLY_REQUEST_VALUES on the list, with the you reload the list at PhaseId.RENDER_RESPONSE and so you lost the sorting.

    Solution: use

    
    

    This will reload the list at PhaseId.RESTORE_VIEW before sorting is done by .

    Tested with PrimeFaces Version 3.1.1 and Mojarra 2.1.8

提交回复
热议问题