有时我在selectone菜单中遇到问题,当我单击以选择一个值时,此错误出现在firefox控制台中。
TypeError:this.preShowValue未定义[Conocermás] components.js.jsf:19:5866
我的代码看起来像
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<h:form id="frmOne">
<ui:include src="/pages/header.xhtml" />
<!-- other components -->
<p:outputPanel id="selectExample">
<div class="ui-g">
<div class="ui-g-12 ui-md-6 ui-lg-5 ">
<div class="ui-g ">
<p:outputLabel
value="${etiqueta['selectLabel']}"
for="somExample" />
<p:selectOneMenu id="somExample" name="somExample"
value="#{selectController.selectedValue}"
required="true" converter="selectConverter"
requiredMessage="${mensaje['mandatoryInput']}">
<f:selectItem itemLabel="Select" value="#{null}" />
<f:selectItems
value="#{selectController.selectValues}"
var="selectOption" itemValue="#{selectOption}"
itemLabel="#{selectOption.name}" />
<p:ajax event="change"
listener="#{selectController.selectValueChanged()}"
process="@this" />
</p:selectOneMenu>
<p:message for="somExample" id="msgSomExample"></p:message>
</div>
</div>
</div>
</p:outputPanel>
<!-- other components -->
<ui:include src="/pages/dialogs/_dialogs.xhtml" />
</h:form>
</ui:composition>
_dialogs.xhtml看起来像:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
xmlns:jsf="http://xmlns.jcp.org/jsf">
<p:dialog header="Dialog"
appendToBody="true" responsive="true"
widgetVar="dlgDialogOne" modal="true" closable="false"
width="400">
<div class="ui-g">
<div class="ui-g-12">
<h:outputLabel
value="Message" />
</div>
<div class="ui-g-12 centrado-texto">
<p:commandButton value="Yes"
update="frmOne"
onclick="PF('dlgDialogOne').hide();" process="@this"
action="#{selectController.dialogOk()}" />
<p:spacer styleClass="spaceBetweenButtons" />
<p:commandButton value="No"
onclick="PF('dlgDialogOne').hide();" process="@this"
action="#{selectController.dialogNo()}"
update="frmOne" />
</div>
</div>
</p:dialog>
</ui:composition>
我正在使用Primefaces 6.2和Jboss EAP7 在Firefox中,该错误在15个测试中出现了一次 在Chrome中,错误在22个测试中出现了一次
感谢您的帮助