gpt4 book ai didi

javascript - 寻找富有的状态 :collapsiblePanel on change event

转载 作者:行者123 更新时间:2023-12-03 09:19:35 25 4
gpt4 key购买 nike

如何获取 rich:collapsiblePanel 的当前状态(展开或折叠)

<rich:collapsiblePanel header="Search" switchType="client" id="searchId" onswitch="checkState();">
Panel To show the Data
</rich:collapsiblePanel>

我的 JavaScript 代码是

function checkState() {
//Here how to get the current state
var st = #{rich:element('searchId')}.isExpanded();
alert(st);
}

更新了我的 Java 脚本,但出现以下错误。我们正在使用 4.3.4 Jars
未捕获的类型错误:document.getElementById(...).isExpanded 不是函数

最佳答案

RichFaces.component("formId:panelId").isExpanded()

阅读documentation .

编辑:对于 4.5.4 及以下版本:

RichFaces.component("formId:panelId").activeItem == "true"

关于javascript - 寻找富有的状态 :collapsiblePanel on change event,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31875722/

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