Advice wanted

UI Components for JSF
Post Reply
ArthurD
Posts: 1
Joined: 20 Jun 2023, 08:17

20 Jun 2023, 08:21

Hello,
I am trying to use the p:inplace tag. I have this mapped to a bean variable 'dayOfMoth' annotated to have a value between 1-31

Code: Select all

	@Max(31)
	@Min(1)
	private Integer dayOfMonth = 1;
I use the following Facelet code

Code: Select all

					<p:panelGrid styleClass="panelGridCenter" columns="3">
						<p:outputLabel  >Day of Month</p:outputLabel>
						<p:inplace id="aDay" editor="true">
							<p:inputText value="#{configBean.dayOfMonth}"
								required="true" label="text" />
						</p:inplace>
						<p:message id="msg1" for="aDay"/>
					</p:panelGrid>
This displays fine. When enter a value outside the 1-31 range, I do get the error but the error message does not display. I see the following in the logs:

There are some unhandled FacesMessages, this means not every FacesMessage had a chance to be rendered.
These unhandled FacesMessages are:
- text: must be less than or equal to 31

How can code it so that the error message is displayed?
Thanks ;)

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

23 Jun 2023, 20:14

I don;t think the ID should be on the `inplace` it should be on the `input` since that is what is throwing the validation error so the message is not associated with the correct input id.

Can you try this?

Code: Select all

<p:panelGrid styleClass="panelGridCenter" columns="3">
						<p:outputLabel  >Day of Month</p:outputLabel>
						<p:inplace editor="true">
							<p:inputText id="aDay" value="#{configBean.dayOfMonth}"
								required="true" label="text" />
						</p:inplace>
						<p:message id="msg1" for="aDay"/>
					</p:panelGrid>
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 19 guests