简体   繁体   English

a4j:ajax可用事件的详尽列表?

[英]Exhaustive list of available events for a4j:ajax?

Where can I get the exhaustive list of available events for <a4j:ajax event="..." /> ? 在哪里可以获取<a4j:ajax event="..." />的可用事件的详尽列表?

RichFaces's doc says "name of JavaScript event property (click, change, etc.)" , but I'm precisely looking for this "etc." RichFaces的文档“ JavaScript事件属性的名称(单击,更改等)” ,但我正是在寻找这个“等”。 ;) ;)

Side note: I'm note sure it refers exactly to the JavaScript events names since AFAIK, you have to use selectitem rather than select ... 旁注:我要确保自AFAIK以来,它完全指的是JavaScript事件名称 ,您必须使用selectitem而不是select ...

To recite RichFaces component reference on the subject (emphasis mine): 要朗读有关此主题的RichFaces组件参考 (重点是我的):

The <a4j:ajax> behavior allows Ajax capability to be added to a non-Ajax component. <a4j:ajax>行为允许将Ajax功能添加到非Ajax组件。 The non-Ajax component must implement the ClientBehaviorHolder interface for all the event attributes that support behavior rendering . 非Ajax组件必须为所有支持行为渲染的事件属性实现ClientBehaviorHolder接口

To proceed one step further one should look into ClientBehaviorHolder interface, especially the ClientBehaviorHolder#getEventNames() method that 要继续进行下一步,应该查看ClientBehaviorHolder接口,尤其是ClientBehaviorHolder#getEventNames()方法

Returns a non-null, unmodifiable Collection containing the names of the logical events supported by the component implementing this interface 返回一个非空,不可修改的Collection, 其中包含实现此接口的组件所支持的逻辑事件的名称。

This way it would not be too tough to find out the list of events the component can fire. 这样,找出组件可以触发的事件列表就不会太困难。

Basically, as you suspected, all basic JavaScript events are supported and a set of custom ones that are (typically) mentioned in component's documentation (those with on prefix), but with prefix omitted (like onlistshow would turn into event="listshow" ). 基本上,正如您所怀疑的那样,所有基本JavaScript事件均受支持,并且一组(通常)在组件文档中提到的自定义事件(带有on前缀的事件),但省略了前缀(例如onlistshow将变成event="listshow" ) 。

Also, it is worth mentioning that there are two additional 'standard' event types in JSF that will render the necessary/right HTML DOM event, depending on the component in question. 另外,值得一提的是,JSF中还有两种“标准”事件类型,它们将根据所涉及的组件来呈现必要/正确的HTML DOM事件。 Those are action for components that implement ActionSource interface and valueChange for components that implement EditableValueHolder . 这些都是action为实现组件ActionSource接口和valueChange为实现组件EditableValueHolder

The list of available events depends on what component you're working with. 可用事件的列表取决于您正在使用的组件。 All the Mouse, Keyboard and Form events should be supported (not sure about the onerror and such) and if you're working with, say, <rich:select> you get access to custom events like listclick , listdblclick , selectitem etc. which are described in the docs . 应该支持所有的Mouse,Keyboard和Form事件(不确定onerror等),如果正在处理<rich:select> ,则可以访问自定义事件,例如listclicklistdblclickselectitem等。在文档中进行了描述。

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

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