I need to display a FacesMessage
for this component as shown below,
The issue is that it is displayed on the UI multiple times as shown below,
Secondly, the date entered was 40.06.2015
which is invalid, hence the FacesMessage
, but it got converted into 10.07.2015
. I have no idea how to prevent this. Any help is highly appreciated. I know that it can be easily handled with setLenient()
on the DateFormat
class, but somehow before it is available to me in the backened, the UI component converts it into date of next month.
The validator attached to this component is as follows:
So, how to avoid this displaying of "Please enter date in correct format" multiple times?
I thought of using h:message
rather than h:messages
, and in the catch block of the validator method to go like this
FacesContext.getCurrentInstance().addMessage("formId:aboveCompId", message);
but nothing gets displayed on UI. Any suggestions?