Rick Fishman
Rick Fishman

Reputation: 91

Don't receive events in PrimeFaces DataTable if I extend it

I am extending the PrimeFaces DataTable. When I do this, I no longer get the Ajax events that I receive when I don't extend it. It isn't anything that I do in the extension because I removed all methods in my overridden DataTable and still no Ajax events.

Here is the relevent code:

public class MyDataTable extends DataTable {
}

In my faces-config.xml:

<component>
    <component-type>org.primefaces.component.DataTable</component-type>
    <component-class>com.xxx.MyDataTable</component-class>
</component>

That's it...after doing this, the events that the DataTable normally receives (in my case it is the contextMenu event) don't get received any more. Besides that, the DataTable seems to function like it does normally.

Do I need to do something else to cause the events to flow? I can't figure out if this is something I am doing, a PrimeFaces bug or a MyFaces bug.

I got the PrimeFaces source code and put a breakpoint in the queueEvent(event) method. It gets hit if I don't extend the control but doesn't if I extend it.

I am using PrimeFaces 3.5 and the MyFaces 2.1.5 implementation that comes with WebSphere 8.5.1.

Thanks for any help. Nobody on the PrimeFaces forum replied to my question so I am really getting desperate...

Upvotes: 4

Views: 332

Answers (1)

bibi87
bibi87

Reputation: 11

I renamed my custom dataTable to DataTable and get the Ajax events.

public class DataTable extends org.primefaces.component.datatable.DataTable {
}

Upvotes: 1

Related Questions