【发布时间】:2015-01-29 20:56:15
【问题描述】:
我是这个网站的新手 我的问题与 primefaces 中的 SelectBooleanCheckbox 有关。 每当我提交表单时,复选框都会被取消选中。 我正在使用动态标签视图。
这是我的 xhtml 代码:-
<h:form id="form" >
<p:panel id="tagsPanel" >
<p:tabView id="tabView" style="background-color:transparent;background-image:none;" var="tabKey" value="#{MBean.Names}"
dynamic="true" >
<p:dataGrid var="appSettingsList" value="#{appSettingsMBean.tabData[tabKey]}" columns="1" styleClass="plainDataGrid">
<h:panelGrid columns="2" border="0" cellspacing="0" cellpadding="0" columnClasses="JspContent12 ,JspContent22" width="100%" >
<p:column escape="false" >
<p:selectBooleanCheckbox value="#{appSettingsList.resultValues.checkboxValue}" style="float:left" id="checkBoxValue"
rendered="#{appSettingsList.currentValues != null and appSettingsList.currentValues.size() > 0 and
appSettingsList.displayType.equalsIgnoreCase('single') and appSettingsList.dataType.equalsIgnoreCase('boolean')}">
</p:selectBooleanCheckbox>
</p:column>
</h:panelGrid>
</p:dataGrid>
</p:panel>
<p:panel border="0" id="buttonRow" style="text-align:center;border-width:0;border-style:none;background-image:none;" >
<p:commandButton value="Save" id="save" actionListener="#{MBean.saveSettings()}" ajax="false" style="width:130px" />
</p:panel>
</h:form>
更改选项卡并单击保存btn时,复选框仍保留检查
但是,当只点击保存按钮时,它会被取消选中
任何帮助将不胜感激...
【问题讨论】:
-
您好,欢迎来到 Stack Overflow。提问时请使用 MCVE stackoverflow.com/help/mcve
标签: jsf primefaces jsf-2.2