Page 1 of 1

Calendar for filtering

Posted: 06 May 2011, 20:04
by kingdan
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.

tnx

Re: Calendar for filtering

Posted: 17 Aug 2011, 15:49
by cabbage123
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!

Re: Calendar for filtering

Posted: 17 Aug 2011, 15:56
by cagatay.civici
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.

Re: Calendar for filtering

Posted: 17 Aug 2011, 16:06
by cabbage123
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"/>
</p:calendar>
</f:facet >

<h:outputText value="#{log.logDate}" />
</p:column>
to retrieve the log information within one day on calendar...but the result still not right...

Re: Calendar for filtering

Posted: 17 Aug 2011, 19:29
by cabbage123
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!