Validation 输入验证失败时未调用valueChangeListener
在selectOneMenu中,当针对f:validator、f:attribute的验证失败时,valueChangeListener不会被调用,我也尝试了immediate=“true”,但没有成功。 非常感谢您的帮助。谢谢。 下面是代码片段:Validation 输入验证失败时未调用valueChangeListener,validation,jsf,primefaces,selectonemenu,valuechangelistener,Validation,Jsf,Primefaces,Selectonemenu,Valuechangelistener,在selectOneMenu中,当针对f:validator、f:attribute的验证失败时,valueChangeListener不会被调用,我也尝试了immediate=“true”,但没有成功。 非常感谢您的帮助。谢谢。 下面是代码片段: <p:selectOneMenu id="firstinputselectone" rendered="#{!dynamicUIPreEnrollmentAction.singleProfile}"
<p:selectOneMenu id="firstinputselectone" rendered="#{!dynamicUIPreEnrollmentAction.singleProfile}"
valueChangeListener="#{dynamicUIPreEnrollmentAction.showLayoutPreview}"
styleClass="#{extraFieldDTO.isReadOnly eq '1' ?'disabledInputFieldSelectItem' :'enabledInputFieldSelectItem'}"
disabled="#{extraFieldDTO.isReadOnly eq '1'}"
value="#{extraFieldDTO.stringFieldValue}">
<f:selectItem itemLabel="#{msg.DROP_SELECTONE}"
id="selectItem_24" />
<f:selectItems
value="#{dropDownParserAction.getGenericLinkedKeyValueListMap(null,extraFieldDTO.dropDownSearchValue,extraFieldDTO.dropDownType,extraFieldDTO.firstLinkedDropDownType)}"
id="selectItems_24655" />
<p:ajax event="change" id="ajax_2" update="@form" />
<f:validator validatorId="dynamicUIValidator" />
<f:attribute name="DYNAMICUIDATAOBJECT" value="#{extraFieldDTO}" />
</p:selectOneMenu>
</h:panelGroup>
</p:fieldset>
<p:spacer width="50" />
<p:fieldset legend="#{msg.LBL_BACKCARD}" toggleable="false"
style="width:400px;height:400px;background-color:#e6e6e6">
<h:panelGroup>
<br clear="none" />
<br clear="none" />
<br clear="none" />
<br clear="none" />
<p:spacer height="40" />
<h:graphicImage id="layout_present_idar590" rendered="#{dynamicUIPreEnrollmentAction.backProfileLayout ne null}"
value="data:image/jpg;base64,#{dynamicUIPreEnrollmentAction.backProfileLayout}" />
</h:panelGroup>
</p:fieldset>
</h:panelGrid>
</div>
</p:outputPanel>
</h:panelGroup>
</p:fieldset>
<p:spacer width="50" />
<p:fieldset legend="#{msg.LBL_BACKCARD}" toggleable="false"
style="width:400px;height:400px;background-color:#e6e6e6">
<h:panelGroup>
<br clear="none" />
<br clear="none" />
<br clear="none" />
<br clear="none" />
<p:spacer height="40" />
<h:graphicImage id="layout_present_idar590" rendered="#{dynamicUIPreEnrollmentAction.backProfileLayout ne null}"
value="data:image/jpg;base64,#{dynamicUIPreEnrollmentAction.backProfileLayout}" />
</h:panelGroup>
</p:fieldset>
</h:panelGrid>
</div>
</p:outputPanel>
谢谢,我通过在布局面板中使用rendered=“!facesContext.validationFailed”获得了解决方法,验证失败时不应呈现该方法。
以下是代码片段:
谢谢,我通过在布局面板中使用rendered=“!facesContext.validationFailed”获得了解决方法,验证失败时不应呈现该方法。
以下是代码片段:
如果验证失败,那么就没有新值的方法,因此它是合乎逻辑的,不会被调用。到底是什么