dataTable filter event

UI Components for JSF
luisalves00
Posts: 71
Joined: 21 Feb 2011, 18:37

23 Sep 2011, 18:16

hello,

is there any event on the dataTable when the user use the filter? onFilter or something like that?

I got 2 data tables...the 1st on filters the second one...it's go so far.

When I got a item picked from the fist one and another on the second one...I use the filter on the first on...and this cause the problem, because the first table loses the selection and I don't have an event to reset the second one...

any suggestion?

best regards,
la00

Cool Mr Ice
Posts: 46
Joined: 17 Sep 2011, 11:53

02 Oct 2011, 21:41

I don't know if this will help the situation you describe, but 3.0.M3 DataTable events are as follows:
  • rowSelect (SelectEvent)
    rowUnselect (UnselectEvent)
    page (PageEvent)
    sort (SortEvent)
    filter (AjaxBehaviorEvent)
    rowEdit (RowEditEvent)
    colResize (ColumnResizeEvent)
Example...

Code: Select all

<p:dataTable id="tableID" ...>
                    <p:ajax event="rowSelect" update="@this"/>
                    <p:ajax event="rowUnselect" update="@this"/>
                    <p:ajax event="page" listener="#{viewScopedManagedBean.onPage}"/>
                    <p:ajax event="sort" listener="#{viewScopedManagedBean.onSort}"/>
                    <p:ajax event="filter" listener="#{viewScopedManagedBean.onFilter}"/>
column definitions etc...
</p:dataTable>

Code: Select all

    public void onPage(PageEvent event) {
//do stuff
    }
    
    public void onSort(SortEvent event) {
//do stuff
    }
    
    public void onFilter(AjaxBehaviorEvent event) {
//do stuff
    }
There may be others of which I am unaware, but these are the ones I saw in the source code.
PrimeFaces 3.5
JSF 2.1
Mojarra 2.1.3
Glassfish 3.1.1
Netbeans 7.0.1
JDK 7
JEE 6

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

02 Oct 2011, 23:57

Code: Select all

p:ajax event="filter" ...

luisalves00
Posts: 71
Joined: 21 Feb 2011, 18:37

03 Oct 2011, 10:04

yeah that's nice...but I'm stuck on a pre M1 snapshot...

do you have any idea for this case?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

03 Oct 2011, 22:07

Get unstuck :-)

ceng
Posts: 14
Joined: 20 Jul 2012, 14:18

13 Sep 2012, 09:06

Cool Mr Ice wrote:I don't know if this will help the situation you describe, but 3.0.M3 DataTable events are as follows:
  • rowSelect (SelectEvent)
    rowUnselect (UnselectEvent)
    page (PageEvent)
    sort (SortEvent)
    filter (AjaxBehaviorEvent)
    rowEdit (RowEditEvent)
    colResize (ColumnResizeEvent)
Example...

Code: Select all

<p:dataTable id="tableID" ...>
                    <p:ajax event="rowSelect" update="@this"/>
                    <p:ajax event="rowUnselect" update="@this"/>
                    <p:ajax event="page" listener="#{viewScopedManagedBean.onPage}"/>
                    <p:ajax event="sort" listener="#{viewScopedManagedBean.onSort}"/>
                    <p:ajax event="filter" listener="#{viewScopedManagedBean.onFilter}"/>
column definitions etc...
</p:dataTable>

Code: Select all

    public void onPage(PageEvent event) {
//do stuff
    }
    
    public void onSort(SortEvent event) {
//do stuff
    }
    
    public void onFilter(AjaxBehaviorEvent event) {
//do stuff
    }
There may be others of which I am unaware, but these are the ones I saw in the source code.
<p:ajax event="filter" listener="#{viewScopedManagedBean.onFilter}"/>

Hi,

is there a way to get selected filter option in filter event listener? i want to do a two-level filter that when first filter changes, second filter options decreases in number depends on first choice. is it possible on datatable? i want to use filter attributes if possible, not selectone etc.

thanks

primefacestrend
Posts: 17
Joined: 15 Nov 2013, 16:40

10 Jun 2014, 18:34

Anything on this

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

11 Jun 2014, 10:06

Yes, the forum postingrules!

NourDev
Posts: 30
Joined: 13 Oct 2015, 20:25

14 Jun 2016, 14:56

Any update on this item please ?

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

14 Jun 2016, 16:48

update on WHAT?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 35 guests