gpt4 book ai didi

java - h : component and a4j:components? 之间的差异

转载 作者:太空宇宙 更新时间:2023-11-04 06:44:41 30 4
gpt4 key购买 nike

我搜索并获取了以下信息。
请添加您的信息

h:commandbuttona4j:commandButton 相同,唯一的区别是 a4j:commandButton 有额外的 ajax 请求。

a4j:commmandButton 不用于页面导航。
h:commandLinka4j:commandLink 相同,唯一的区别是 a4j:commandLink 有额外的 ajax 请求。

我想知道何时必须使用 h:commandButtona4j:commandButtonh:commmandLinka4j:commandLink

h:commandLinkh:outputlink 有什么区别?h:commandLink 有提交操作,而 h:outputlink 没有。

当我们想要从一个页面导航到另一页面时,使用

h:outputLink
但是对于导航,我们可以使用 h:commandlink 那么 h:outputLink 有什么用呢?

最佳答案

h: 标签和 a4j: 标签非常相似,除了 documentation 之外。对于 a4j: 表示:(稍微解释一下)

a4j: is similar to the standard h:, but produces an Ajax request with a further partial page update. 'reRender' attribute points to the component(s) that should be re-rendered in the component tree and updated in the browser DOM after an Ajax Response is completed.

<小时/>

h: link 标签之间的区别:

渲染一个完整的 HTML 元素,其 href 属性中包含正确的 URL,从而触发可添加书签的 GET 请求。它不能直接调用托管 bean 操作方法。

<h:outputLink value="destination.xhtml">link text</h:outputLink>

使用 onclick 脚本呈现 HTML 元素,该脚本提交(隐藏)POST 表单并可以调用托管 bean 操作方法。它还需要放置在 .

<h:form>
<h:commandLink value="link text" action="destination" />
</h:form>

有关不同链接的更多信息:查看 this出来!

关于java - h : component and a4j:components? 之间的差异,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24161456/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com