gpt4 book ai didi

jsf - 富:clientId,富:component and rich:element?有什么区别

转载 作者:行者123 更新时间:2023-12-04 22:18:04 26 4
gpt4 key购买 nike

我的意思是这三个富人的论点:

#{rich:clientId('id')}
#{rich:element('id')}
#{rich:component('id')}

例如在这些方法调用(actionListener)中:
 <a4j:support event="onchange" ajaxSingle="true"
actionListener="#{Bean.actionReset('#{rich:clientId('id')}')}"
oncomplete="jsFunction(this.value).text;" />

最佳答案

您可以查看 documentation RichFaces 以获取差异:

丰富的:clientId

The rich:clientId('id') function returns the client identifier related to the passed component identifier ('id'). If the specified component identifier is not found, null is returned instead.



示例:您有一个带有 id="myId" 的组件在您的页面中。该组件不在结构的顶层。 rich:clientId(id)将返回生成的组件的 HTML id。这可能类似于 myForm:myPanel:myId .

丰富:组件

The rich:component('id') function is equivalent to the RichFaces.$('clientId') code. It returns the client object instance based on the passed server-side component identifier ('id'). If the specified component identifier is not found, null is returned instead. The function can be used to get an object from a component to call a JavaScript API function without using the component.



此方法将返回一个 JavaScript 对象,您可以在该对象上调用一些 RichFaces 函数。这取决于您引用的组件。

丰富:元素

The rich:element('id') function is a shortcut for the equivalent document.getElementById(#{rich:clientId('id')}) code. It returns the element from the client, based on the passed server-side component identifier. If the specified component identifier is not found, null is returned instead.



此方法将返回给定组件 ID 的 HTML dom 元素。

关于jsf - 富:clientId,富:component and rich:element?有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21872603/

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