我可以将哪些值传递给 f:ajax 标记的事件属性?
我试图找到可以传递给 f:ajax
标记的属性 event
的所有可能值的列表。
我知道我还可以从 .js 文件传递函数名称,但我只需要 JSF 附带的函数名称。
我只知道单击鼠标悬停和按键,但我确信还有更多。只是不知道在哪里可以找到它们。
I am trying to find a list of all the possible values I can pass to the attribute event
of the f:ajax
tag.
I know that I can also pass function names from my .js files, but what I need just the ones that come with JSF.
I only know about click mouseover and keyup, but I am sure there are more. Just don't know where to find them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
的event
属性可以容纳至少所有受支持的由相关 Faces 组件生成的 HTML 元素的 DOM 事件。找到所有这些的一个简单方法是检查 Faces 标签库文档,然后删除“on”前缀。例如,
组件< /a> 呈现列出了以下
on*
属性(我已经删除了其中的“on”前缀,以便它最终成为 DOM事件类型名称):blur
change
click
dblclick
focus
keydown< /code>
按键
keyup
mousedown
mousemove
mouseout
鼠标悬停
>鼠标悬停
select
此外,Faces 还有两个特殊事件名称
EditableValueHolder
和ActionSource
组件,渲染的真实 HTML DOM 事件取决于组件类型:valueChange
(将在文本/选择输入上呈现为change
,在单选/复选框输入上呈现为click
)action
(将呈现为click
> 在命令链接/按钮上)以上两个是相关组件的默认事件。
某些 Faces 组件库具有额外的自定义事件名称,通常是更专业的
valueChange
或action
事件,例如 PrimeFaces
其中支持tabChange
、itemSelect
、itemUnselect
、dateSelect
、page
、排序
,filter
、close
等取决于父
组件。您可以在PrimeFaces 用户指南中每个组件章节的“Ajax 行为事件”小节中找到它们。The
event
attribute of<f:ajax>
can hold at least all supported DOM events of the HTML element which is been generated by the Faces component in question. An easy way to find them all out is to check allon*
attribues of the Faces input component of interest in the Faces tag library documentation and then remove the "on" prefix. For example, the<h:inputText>
component which renders<input type="text">
lists the followingon*
attributes (of which I've already removed the "on" prefix so that it ultimately becomes the DOM event type name):blur
change
click
dblclick
focus
keydown
keypress
keyup
mousedown
mousemove
mouseout
mouseover
mouseup
select
Additionally, Faces has two more special event names for
EditableValueHolder
andActionSource
components, the real HTML DOM event being rendered depends on the component type:valueChange
(will render aschange
on text/select inputs and asclick
on radio/checkbox inputs)action
(will render asclick
on command links/buttons)The above two are the default events for the components in question.
Some Faces component libraries have additional customized event names which are generally more specialized kinds of
valueChange
oraction
events, such as PrimeFaces<p:ajax>
which supports among otherstabChange
,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 User's Guide.我只是输入了一些我知道无效的值,这是输出:
因此,您可以传递给 事件 的值是
I just input some value that I knew was invalid and here is the output:
So values you can pass to event are