我可以将哪些值传递给 f:ajax 标记的事件属性? [英] What values can I pass to the event attribute of the f:ajax tag?

查看:25
本文介绍了我可以将哪些值传递给 f:ajax 标记的事件属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找到我可以传递给 f:ajax 标签的属性 event 的所有可能值的列表.

I am trying to find a list of all the possible values I can pass to the attribute event of the f:ajax tag.

我知道我也可以从我的 .js 文件中传递函数名,但我只需要 JSF 附带的那些.

I know that I can also pass function names from my .js files, but what I need just the ones that come with JSF.

我只知道 click mouseover 和 keyup,但我相信还有更多.只是不知道在哪里可以找到它们.

I only know about click mouseover and keyup, but I am sure there are more. Just don't know where to find them.

推荐答案

event 属性可以保持至少 由相关 JSF 组件生成的 HTML 元素的所有支持 DOM 事件.找到它们的一种简单方法是检查 JSF 标记库文档 然后删除on"前缀.例如,; 组件 呈现 列出了以下 on* 属性(其中我已经删除了on"前缀,以便它最终成为 DOM 事件类型名称):

The event attribute of <f:ajax> can hold at least all supported DOM events of the HTML element which is been generated by the JSF component in question. An easy way to find them all out is to check all on* attribues of the JSF input component of interest in the JSF tag library documentation and then remove the "on" prefix. For example, the <h:inputText> component which renders <input type="text"> lists the following on* attributes (of which I've already removed the "on" prefix so that it ultimately becomes the DOM event type name):

  • 模糊
  • 改变
  • 点击
  • dblclick
  • focus
  • keydown
  • 按键
  • keyup
  • 鼠标按下
  • mousemove
  • 鼠标移出
  • 鼠标悬停
  • mouseup
  • 选择

此外,JSF 还有两个特殊的事件名称用于 EditableValueHolderActionSource 组件,渲染的真实 HTML DOM 事件取决于组件类型:

Additionally, JSF has two more special event names for EditableValueHolder and ActionSource components, the real HTML DOM event being rendered depends on the component type:

  • valueChange(将在文本/选择输入上呈现为 change 并在单选/复选框输入上呈现为 click)
  • action(将在命令链接/按钮上呈现为 click)
  • valueChange (will render as change on text/select inputs and as click on radio/checkbox inputs)
  • action (will render as click on command links/buttons)

以上两个是相关组件的默认事件.

The above two are the default events for the components in question.

一些 JSF 组件库有额外的自定义事件名称,它们通常是更特殊的 valueChangeaction 事件,例如 PrimeFaces 支持 tabChangeitemSelectitemUnselectdateSelectpagecode>、sortfilterclose 等取决于父 组件.您可以在PrimeFaces 用户指南的每个组件章节的Ajax 行为事件"小节中找到所有这些内容.

Some JSF component libraries have additional customized event names which are generally more specialized kinds of valueChange or action events, such as PrimeFaces <p:ajax> which supports among others tabChange, itemSelect, itemUnselect, dateSelect, page, sort, filter, close, etc depending on the parent <p:xxx> component. You can find them all in the "Ajax Behavior Events" subsection of each component's chapter in PrimeFaces Users Guide.

这篇关于我可以将哪些值传递给 f:ajax 标记的事件属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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