我的问题是 h:selectManyCheckbo 在导航时会丢失值,下面是我的代码:
<h:selectManyCheckbox id="selectGroupsBox"
value="{userCreationWizardBean.selectedGroupsId}"
layout="pageDirection">
<f:selectItems var="Group"
value="#{userCreationWizardBean.terminalsGroups}"
itemLabel="#{terminalsGroup.groupName}"
itemValue="#{terminalsGroup.id}"
itemDisabled="#{Group.defaultGroup}">
</f:selectItems>
<p:ajax event="change" update=":form-top-wizard:numBase" process="selectGroupsBox"
listener="#{userCreationWizardBean.selectedGroupListner}"></p:ajax>
</h:selectManyCheckbox>
如果我使用导航板来回移动,CheckBox 会丢失值:
<div id="top-wizard" class="#{class}">
<ul>
<li class="premier#{wizard_step=='0'?'_active':''}"><p:commandLink
action="#{userCreationWizardBean.getViewAt(0)}" ajax="true"
update=":msg-form:popup_faces-messages"
/></li>
<li class="deuxieme#{wizard_step=='1'?'_active':''}"><p:commandLink
action="#{userCreationWizardBean.getViewAt(1)}" ajax="true"
update=":msg-form:popup_faces-messages"
/></li>
<li class="troisieme#{wizard_step=='2'?'_active':''}"><p:commandLink
action="#{userCreationWizardBean.getViewAt(2)}" ajax="true"
update=":msg-form:popup_faces-messages"
/></li>
<li class="quatrieme#{wizard_step=='3'?'_active':''}"><p:commandLink
action="#{userCreationWizardBean.getViewAt(3)}" ajax="true"
update=":msg-form:popup_faces-messages"
/></li>
</ul>
</div>
当我删除 itemDisabled 属性时,问题就消失了。
似乎我可以使用 jquery css 选择器语法来排除复选框被处理,但仅限于 primefaces 3.3,但我使用的是 3.2。