警告:尽管<p:message autoUpdate= "true" >,但仍有一些未处理的FacesMessages。



大家好,我正在eclipse上进行JSF+PrimeFaces项目,我收到以下警告消息:

WARNING: There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are: 
- The email field is required
- The password field is required

如果我的表单的源代码

<p:tab title="#{msg['stu']}">
<h:panelGrid columns="2" cellpadding="10">
<div class="card container">
<h:form id="formStudent">
<fieldset style="width: 300px; margin-left: 20px;">
<legend>
<h:outputText value="#{msg['page.login.student']}" />
</legend>
<div class="p-field p-grid">
<label for="email" class="p-col-fixed" style="width: 100px"><h:outputText
value="#{msg['email']}" /></label>
<div class="p-col">
<p:inputText id="emailStudent" required="true"
requiredMessage="#{msg['required.email']}"
value="#{studentMB.student.email}" type="email" />
<p:message autoUpdate="true" for="emailStudent" />
</div>
</div>
<div class="p-field p-grid">
<label for="password" class="p-col-fixed" style="width: 100px"><h:outputText
value="#{msg['password']}" /></label>
<div class="p-col">
<p:password id="passwordStudent"
requiredMessage="#{msg['required.password']}"
value="#{studentMB.student.password}" toggleMask="true"
redisplay="true" />
<p:message autoUpdate="true" for="passwordStudent" />
</div>
</div>
<p:commandButton value="#{msg['login']}"
styleClass="ui-button-raised p-mr-2 ui-button-primary"
action="#{studentMB.login}" />
<br />
</fieldset>
</h:form>
</div>
</h:panelGrid>
</p:tab>

请问我该怎么修?感谢

应删除p:message上的autoUpdate属性,代之以:

<p:message for="input-field-id" >
<p:autoUpdate />
</p:message>

相关内容

  • 没有找到相关文章

最新更新