我正在使用richfaces 实现来取消JSF 1.2。我要做的是在选中 selectBooleanCheckbox 时启用 selectOneRadio。到目前为止它有效。但是有一个奇怪的效果:
考虑以下情况:字段 selectA 在其 rich:message 标记中显示错误消息。检查 myCheckbox selectOneRadio 后 selectToReRender 已启用,但页面上所有富消息标签中的错误消息都消失了。
谢谢你的帮助。
问候,
最大限度
<!-- Field which shows error-Message if vlaue was not entered -->
<h:selectOneRadio id="selectA"
value ="#{controller.entity.valueA}"
required="true"
label="#{text['selectA.label']}"
layout="pageDirection">
<f:selectItem itemValue="#{true}" itemLabel="Yes" />
<f:selectItem itemValue="#{false}" itemLabel="No"/>
</h:selectOneRadio>
<rich:message for="selectA"/>
<!-- Field which enables selectOneRadio selectToReRender if it is checked -->
<h:selectBooleanCheckbox id="myCheckbox"
label="#{text['myCheckbox.label']}"
value="#{controller.entity.valueB}"
required="false">
<a4j:support event="onclick" ajaxSingle="true" reRender="selectToReRender"/>
</h:selectBooleanCheckbox>
<rich:message for="myCheckbox"/>
<!-- Field which is disabled until myCheckbox is checked.
Function getSelectToReRenderDisabled() of controller checks the boolean value of controller.entity.valueB -->
<h:selectOneRadio id="selectToReRender"
value="#{controller.entity.valueC}"
label="#{text['selectToReRender.label']}"
layout="pageDirection"
required="true"
disabled="#{controller.selectToReRenderDisabled}">
<f:selectItems value="#{MySelectItems.myEntitySelectItems}"
var="" />
</h:selectOneRadio>
<rich:message for="selectToReRender"/>