TimePicker required not marking itself as invalid

Community Driven Extensions Project
Post Reply
User avatar
jeyViso
Posts: 9
Joined: 19 Nov 2014, 19:49

03 Oct 2016, 12:08

Hi everyody,

We are using a TimePicker as follows:

Code: Select all

<pe:timePicker id="time" widgetVar="time" value="#{modelBean.initTime}" mode="popup" required="true" showOn="button" />
As you can see, is marked as required, so if it has no value, when submit button is clicked I get the error message. That's fine, it's what is expected. The problem is, the component is not marked with the "ui-state-error" style class so the user can see the problem comes from this input.

To be sure everything is correct in the form, I tried to put another required input and check if it's marked with the error class

Code: Select all

<pe:timePicker id="time" widgetVar="time" value="#{userConfigKeyMonthlyProcessInitComputationModelBean.initTime}" mode="popup" required="true" showOn="button" />
<p:inputText required="true"/>
And the input text, marks it self with the class as invalid, so the form submitting is fine.

Then I tried to check manually is the component is valid, and add the style class:

Code: Select all

<pe:timePicker id="time" widgetVar="time" value="#{userConfigKeyMonthlyProcessInitComputationModelBean.initTime}" mode="popup" required="true" showOn="button" styleClass="#{component.valid ? '' : 'ui-state-error'}"/>
But it seems that is the source of the malfunction, because the component is never invalid, even if it's required and it has no value.

Is that a bug? I'm doing something wrong?


Primefaces extensions version: 3.0
Primefaces version: 5.2

Thanks in advance

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

07 Oct 2016, 18:14

PrimeFacesExtensions is a community based project, so please feel free to analyze the problem and provide a PR.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

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

02 Jan 2017, 15:17

I have just tested this with PF Extensions 6.1-SNAPSHOT and required is marking the TimePicker with ui-state-error so I think this is no longer an issue.
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 “Extensions”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests