【发布时间】:2013-06-27 04:58:26
【问题描述】:
我有一个问题。是否可以一次更新两个组件? 我正在尝试这样的代码:
<h:panelGroup id="pickList">
<p:panel rendered="#{customCalender.visible}" widgetVar="searchTableBox">
//Some codes.....
<p:commandButton value="Cancel" update="pickList" actionListener="#{customCalender.closeList}" style="background:#25A6E1;color:red;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;" />
<p:commandButton value="Save" update="custDataTablePanel" actionListener="#{customCalender.saveTargetList}" style="background:#25A6E1;color:red;font-family:'Helvetica Neue',sans-serif;font-size:10px;border-radius:4px;"/>
</p:panel>
</h:panelGroup>
....
.....
<h:panelGroup id="custDataTablePanel">
<p:panel rendered="#{customCalender.dataTableVisible}">
..
..
</p:panel>
</h:panelGroup>
现在我想当我点击Save 按钮时隐藏<h:panelGroup id="pickList"> 并显示<h:panelGroup id="custDataTablePanel"> 所以我有两个布尔值来控制它们的可见性。但我需要更新其中两个面板。我用update="custDataTablePanel" 做的一个它在单击按钮后显示数据表。(在saveTargetList 方法中,我将custDataTablePanel 的可见性更新为true。)但无法隐藏面板pickList。
所以我一直在徘徊,有什么方法可以一键隐藏和显示这两个面板。 请提出建议。
【问题讨论】:
标签: jsf primefaces