简体   繁体   English

如果我扩展它,请不要在PrimeFaces DataTable中接收事件

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

I am extending the PrimeFaces DataTable. 我正在扩展PrimeFaces DataTable。 When I do this, I no longer get the Ajax events that I receive when I don't extend it. 当我这样做时,我不再获得当我不扩展它时收到的Ajax事件。 It isn't anything that I do in the extension because I removed all methods in my overridden DataTable and still no Ajax events. 这不是我在扩展中所做的任何事情,因为我删除了覆盖的DataTable中的所有方法,但仍然没有Ajax事件。

Here is the relevent code: 这是相关代码:

public class MyDataTable extends DataTable {
}

In my faces-config.xml: 在我的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. 就是这样......在这样做之后,DataTable通常接收的事件(在我的情况下是contextMenu事件)不再被接收。 Besides that, the DataTable seems to function like it does normally. 除此之外,DataTable似乎正常运行。

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. 我无法弄清楚这是我正在做的事情,PrimeFaces错误还是MyFaces错误。

I got the PrimeFaces source code and put a breakpoint in the queueEvent(event) method. 我获得了PrimeFaces源代码并在queueEvent(event)方法中放置了一个断点。 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. 我正在使用PrimeFaces 3.5和WebSphere 8.5.1附带的MyFaces 2.1.5实现。

Thanks for any help. 谢谢你的帮助。 Nobody on the PrimeFaces forum replied to my question so I am really getting desperate... PrimeFaces论坛上没有人回复我的问题,所以我真的很绝望......

I renamed my custom dataTable to DataTable and get the Ajax events. 我将自定义dataTable重命名为DataTable并获取Ajax事件。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM