如果我点击末尾的p:commandButton,使用值=“Reservar”,而不选择f:selectItem上的字段,则会更新ID为“bookingMessages”的p:消息(并且正确) 。我现在关闭FacesMessage并再次单击p:commandButon。现在没有任何反应为了让它再次工作,我需要刷新页面。
编辑1:我使用的是PF 5.2和JSF 2.2.8。
关于我的错误在哪里的任何想法?
<h:form id="form" class="Container90 Fnone MarAuto">
<p:messages autoUpdate="true" showDetail="true" closable="true"/>
<p:panel id="panel" header="Reservas de Áreas Comuns" >
<h:panelGrid cellpadding="5">
<p:commandButton value="Incluir" oncomplete="PF('bookingDialog').show()" update=":form:bookingDialog">
<f:setPropertyActionListener value="#{null}" target="#{bookingMoradorController.currentItem}" />
<f:setPropertyActionListener value="newMorador" target="#{bookingMoradorController.action}" />
</p:commandButton>
</h:panelGrid>
<p:dataTable id="dataTable" emptyMessage="Nenhum registro encontrado." class="TexAlCenter" var="object" value="#{bookingMoradorController.reservesMorador}">
<p:column headerText="Unidade" class="Wid8 TexAlCenter">
<h:outputText value="#{object.unit.externalIdentifier}" />
</p:column>
<p:column headerText="Valor (R$)" class="TexAlRight">
<h:outputText value="#{object.feeValue}" />
</p:column>
</p:dataTable>
<p:dialog closeOnEscape="true" showEffect="fade" hideEffect="fade" header="Reservar Área Comum" widgetVar="bookingDialog" resizable="false" id="bookingDialog" modal="true">
<p:messages id="bookingMessages" showDetail="true" closable="true"/>
<h:panelGrid columns="2" cellpadding="5">
<p:outputLabel for="idCommonArea" value="Área Comum"/>
<p:selectOneMenu value="#{bookingMoradorController.selectedIdCommonArea}" id="idCommonArea" effect="fade" style="width: 178px" >
<f:selectItem itemLabel="Selecione um Local" itemValue="#{null}"/>
<f:selectItems value="#{bookingMoradorController.commonAreas}" var="object" itemLabel="#{object.name}" itemValue="#{object.idCommonArea}"/>
</p:selectOneMenu>
<p:outputLabel for="calendarMask" value="Data do Evento"/>
<p:calendar locale="pt" id="calendarMask" value="#{bookingMoradorController.dateEvent}" pattern="dd-MM-yyyy" mask="true" />
</h:panelGrid>
<div class="EmptyBox10"/>
<p:separator/>
<div class="EmptyBox10"/>
<h:panelGrid columns="2" cellpadding="5" class="MarAuto">
<p:commandButton value="Reservar" action="#{bookingMoradorController.save()}" update=":form:dataTable bookingMessages" oncomplete="bookingDialog.hide()" ignoreAutoUpdate="true"/>
<p:commandButton value="Cancelar" class="RedButton" action="/ondomi/morador/bookingList.xhtml?faces-redirect=true" process="@this" />
</h:panelGrid>
</p:dialog>
</p:panel>
</h:form>
谢谢。