JSF 2 事件列表? [英] List of JSF 2 events?

查看:20
本文介绍了JSF 2 事件列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止我只知道和看到过

我想知道在哪里可以找到除 preRenderView 之外的其他页面(或视图)事件的列表?

特别是,我正在寻找在绑定过程之前触发的事件,(preRenderView 在组件绑定后运行)

谢谢.

解决方案

来自 JSF 2.1 的标签库文档

<块引用>

要为其安装侦听器的事件的名称.下表列出此属性的有效值,以及相应的事件为其注册侦听器操作的类型.

<前>type"标签属性的值 发送到监听器方法的事件类型preRenderComponent javax.faces.event.PreRenderComponentEventpreRenderView javax.faces.event.PreRenderViewEventpostAddToView javax.faces.event.PostAddToViewEvent预验证 javax.faces.event.PreValidateEventpostValidate javax.faces.event.PostValidateEvent

除了这些值之外,任何扩展 javax.faces.event.ComponentSystemEvent 的 java 类的完全限定类名都可以用作type"属性的值.

因此,除了上面列出的值之外,您还可以将 javax.faces.event.ComponentSystemEvent 的直接已知子类的完全限定类名用于 type 标签属性,可在 Java 文档

So far I have only known and seen

<f:event type="preRenderView" listener="#{situationHelper.load}"/>

and I wonder where I can find a list of other page (or view) events other than preRenderView?

Particularly, I'm looking for a event which is triggered before the binding proccess, (preRenderView runs after components are bound)

Thanks.

解决方案

From the tag library document of JSF 2.1

Name of the event for which to install a listener. The following table lists the valid values for this attribute, and the corresponding event type for which the listener action is registered.

value for "type" tag attribute        Type of event sent to listener method
preRenderComponent                    javax.faces.event.PreRenderComponentEvent
preRenderView                         javax.faces.event.PreRenderViewEvent 
postAddToView                         javax.faces.event.PostAddToViewEvent 
preValidate                           javax.faces.event.PreValidateEvent 
postValidate                          javax.faces.event.PostValidateEvent

In addition to these values, the fully qualified class name of any java class that extends javax.faces.event.ComponentSystemEvent may be used as the value of the "type" attribute.

So , beside the values listed above , you can also use the fully qualified class name of direct known subclasses of javax.faces.event.ComponentSystemEvent for the type tag attribute , which can be found in the Java docs .

这篇关于JSF 2 事件列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆