filterValue for matchMode="range" with markup for DataTable

UI Components for JSF
Post Reply
dvdbnnfs
Posts: 1
Joined: 23 Sep 2021, 16:46

23 Sep 2021, 17:15

Hi,

I need to set up a default filtering for a DataTable component using markup (not programmaticaly) for matchMode="range" with a column of dates.
I can't figure out the correct syntax for the value of filterValue.
I try something like:

Code: Select all

 <p:column field="date" headerText="Join Date" filterMatchMode="range" filterValue="01/09/2021, 30/09/2021" matchMode="range">
but it never works.

I search for the markup equivalent of

Code: Select all

    filterBy.add(
        FilterMeta.builder()
            .field("date")
            .filterValue(Arrays.asList(LocalDate.now().minusDays(28), LocalDate.now().plusDays(28)))
            .matchMode(MatchMode.RANGE)
            .build());
Could you Help me ?
thanks.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

25 Sep 2021, 00:40

I could be wrong but I dont think you can set the range in filterValue in the XHTML like that.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 46 guests