作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何获取 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/
如何获取 rich:collapsiblePanel 的当前状态(展开或折叠) Panel To show the Data 我的 JavaScript 代码是 function checkSta
我是一名优秀的程序员,十分优秀!