You can use the MessageUtils Class and its method addmessage
http://myfaces.apache.org/javadoc/impl/org/apache/myfaces/util/MessageUtils.html

addMessage(javax.faces.application.FacesMessage.Severity severity, 
java.lang.String messageId, java.lang.Object[] args, java.lang.String 
forClientId, javax.faces.context.FacesContext facesContext) 

There you can add a Object[] which could contain your field.

In the message in the properties file you simple say:

messageId=Error in field {0}

where{0} comes from the Object[]

Regards
Andy

-----Ursprüngliche Nachricht-----
Von: Berlin Brown [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 22. November 2005 21:36
An: [email protected]
Betreff: Java Server Faces question


Sorry, first time user; java server faces question may be unrelated to MyFaces.

Is there a way to add an extra message to
javax.faces.component.UIInput.REQUIRED.  For example, this is defined
in a properties file.  But is there a way to append extra stuff to the
message, some form of event listener to inject an extra message.

javax.faces.component.UIInput.REQUIRED=error, please correct

For example, here I want to add the field that is required.


______________________________________________________________________

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
your system manager.

This footnote also confirms that this email message has been swept
for the presence of computer viruses.
______________________________________________________________________

Reply via email to