requiredMessage not shows for p:selectOneMenu

UI Components for JSF
Post Reply
nixonyeung
Posts: 5
Joined: 11 Nov 2020, 09:40

19 Jan 2022, 02:56

PF version 11.0.0

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>

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

20 Jan 2022, 18:09

Please open an issue on GitHub issues: https://github.com/primefaces/primefaces/issues
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests