I have a form includes an inputtext and a selectonemenu. validateClient is set to true to verify the values are input and selected. But for the selectonemenu if I haven't on focus the element, the requiredMessage "Magistracy is required" will not show up when I clicking the Submit button. Please have a look, thanks.
Code: Select all
<h:form id="detail-form">
<p:dialog header="Departmental Summons" widgetVar="DetailDialog" width="80%" modal="true" fitViewport="true" closeOnEscape="false" position="top" blockScroll="true">
<p:outputPanel id="detail-content">
<div class="grid ">
<div class="col-12 text-right pt-3">
<span style="color: red;">*</span> Required Field
</div>
</div>
<div class="grid ui-fluid ai-b">
<div class="col-3 ">
<p:outputLabel value="Departmental Reference No." />
<span style="color: red;">*</span>
</div>
<div class="col-9">
<p:inputText value="#{departmentalSummonsBean.detailRecord.emailTmplFuncName}" required="true" requiredMessage="Departmental Reference No. is required" />
<p:message for="@previous" />
</div>
<div class="col-3 ">
<p:outputLabel value="Magistracy" />
<span style="color: red;">*</span>
</div>
<div class="col-3">
<p:selectOneMenu autoWidth="false" value="#{departmentalSummonsBean.detailRecord.emailTmplId}" required="true" requiredMessage="Magistracy is required">
<f:selectItem itemLabel="" itemValue="" />
<f:selectItem itemLabel="ES - Mag. Courts" itemValue="ES" />
<f:selectItem itemLabel="FL - Mag. Courts" itemValue="FL" />
</p:selectOneMenu>
<p:message for="@previous" />
</div>
</div>
</p:outputPanel>
<f:facet name="footer">
<div class="grid">
<div class="col-6"></div>
<div class="col-6" align="right">
<p:commandButton value="Submit" resetValues="true" validateClient="true" ajax="false" icon="pi pi-save" class="mr-2" update="detail-form " />
<p:commandButton type="button" value="Cancel" icon="pi pi-times" styleClass="ui-button-secondary" onclick="PF('DetailDialog').hide();" />
</div>
</div>
</f:facet>
</p:dialog>
</h:form>