我可以将哪些值传递给 f:ajax 标记的事件属性?

发布于 2024-12-11 15:20:05 字数 171 浏览 0 评论 0原文

我试图找到可以传递给 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

东北女汉子 2024-12-18 15:20:05

event 属性可以容纳至少所有受支持的由相关 Faces 组件生成的 HTML 元素的 DOM 事件。找到所有这些的一个简单方法是检查 Faces 标签库文档,然后删除“on”前缀。例如, 组件< /a> 呈现 列出了以下 on* 属性(我已经删除了其中的“on”前缀,以便它最终成为 DOM事件类型名称):

  • blur
  • change
  • click
  • dblclick
  • focus
  • keydown< /code>
  • 按键
  • keyup
  • mousedown
  • mousemove
  • mouseout
  • 鼠标悬停 >
  • 鼠标悬停
  • select

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

  • valueChange(将在文本/选择输入上呈现为 change,在单选/复选框输入上呈现为 click
  • action(将呈现为 click > 在命令链接/按钮上)

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

某些 Faces 组件库具有额外的自定义事件名称,通常是更专业的 valueChangeaction 事件,例如 PrimeFaces 其中支持 tabChangeitemSelectitemUnselectdateSelectpage排序filterclose 等取决于父 组件。您可以在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 all on* 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 following on* 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 and ActionSource components, the real HTML DOM event being rendered depends on the component type:

  • 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.

Some Faces 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 User's Guide.

赢得她心 2024-12-18 15:20:05

我只是输入了一些我知道无效的值,这是输出:

HtmlPanelGrid 不支持“whatToInput”事件。
请指定以下受支持的事件名称之一:click、dblclick、
keydown、keypress、keyup、mousedown、mousemove、mouseout、mouseover、
鼠标松开。

因此,您可以传递给 事件 的值是

  • click
  • dblclick
  • keydown
  • mousedown
  • mousemove
  • mouseover
  • mouseup

I just input some value that I knew was invalid and here is the output:

'whatToInput' is not a supported event for HtmlPanelGrid.
Please specify one of these supported event names: click, dblclick,
keydown, keypress, keyup, mousedown, mousemove, mouseout, mouseover,
mouseup.

So values you can pass to event are

  • click
  • dblclick
  • keydown
  • mousedown
  • mousemove
  • mouseover
  • mouseup
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文