Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

requiredMessage duplicating returned EL string

alix jermyn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi guys, a small but annoying problem

I am using a simple requiredMessage attribute to display the validation error message on the listbox below when a data is not selected

<h:selectOneListbox id="selectDateId" value="#{dateBean.selectedDate}" size="12" required="true" requiredMessage="#{msg.date_required}" >

The error message is correctly showing up in the messages element below, except that it is duplicated.

<h:messages showDetail="true" fatalClass="messageFatal" errorClass="messageError" warnClass="messageWarn" infoClass="messageInfo" />

If I set showDetail="false", there is no duplication, so I am presuming that the FacesMessage that is being created behind the scenes is filling both the summary and detail fields with the same value. Does anyone know of any workaround to stop this duplication - I would prefer to leave the showDetail="true" to pick up other messages that do have genuine detail fields


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic