Board index JavaServer Faces General Calendar for filtering

Calendar for filtering

Components, Ajax Framework, Utilities and More.

Post 06 May 2011, 20:04

Posts: 44
Location: Aracaju, Brazil
As I can see, it's not possible to use a Calendar component for filtering in a datatable.

In my datatable i have two Date fields (Initial Date and Final Date) and i wish i could make a filter to show elements only between these Date fields.
Anyone have a suggestion?

ps: Will Primefaces have the option to customize the filter field? Something like a facet that we could do anything we want. It would be nice.

Move Fast, Break Things!

Post 17 Aug 2011, 15:49

Posts: 3
I have the same problem here, don't know how to filter with calendar chosen date...Does anyone have any ideas or provide some hint? Thanks a lot!

Post 17 Aug 2011, 15:56

Posts: 17241
Location: Cybertron

Calendar filtering is not supported, still you can place a calendar inside a column header and bind a dateSelect ajax behavior and do your own filtering.

Post 17 Aug 2011, 16:06

Posts: 3
I have revised my code as
<p:column headerText="Log Date">
<f:facet name="header">
<p:calendar id="beginDate" mode="popup" pattern="yyyy-MM-dd">
<p:ajax event="dateSelect" listener="viewLogs.handleDateSelect" update="logs"/>
</f:facet >

<h:outputText value="#{log.logDate}" />
to retrieve the log information within one day on calendar...but the result still not right...
Last edited by cabbage123 on 17 Aug 2011, 21:21, edited 1 time in total.

Post 17 Aug 2011, 19:29

Posts: 3
Also I have go through all the posts about calender and filter in forum, but didn't find too much posts that are helpful.
Could someone provide some more detailed information or examples? Thanks in advance!

Return to General