I want to show the asterisk only in error cases. It is not limited on required fields. I want to ease the finding of incorrect fields because I don't have enough room to display detailed error messages beside my fields in the form. So I have to show a detailed summary on top of my page and an asterisk or somewhat beside the fields.
But I don't know how to achieve this :-( -----Original Message----- From: Sean Schofield [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 22. Februar 2006 08:50 To: MyFaces Discussion Subject: Re: simple identification of incorrect fields Do you only want to show them when they fail to submit a required value or do you want to show them all of the time? Sean On 2/22/06, Michael Heinen <[EMAIL PROTECTED]> wrote: > I was afraid of having to do this. > Actually I don't want to override the messages because I want to show > them in a summary list at the top of my page. > > I just want to mark the incorrect fields in addition. > Is there no other possibility or workaround? > > -----Original Message----- > From: Sean Schofield [mailto:[EMAIL PROTECTED] > Sent: Dienstag, 21. Februar 2006 19:19 > To: MyFaces Discussion > Subject: Re: simple identification of incorrect fields > > The required message doesn't work this way. You need to override the > value in Message.properties if you want to use just an asterisk > character. > > The defaults are ... > > javax.faces.component.UIInput.REQUIRED = Validation Error > javax.faces.component.UIInput.REQUIRED_detail = "{0}": Value is > required. > > If you check the spec docs you can see the various ways to overload > these and replace them with your own. > > Sean > > > > On 2/21/06, Michael Heinen <[EMAIL PROTECTED]> wrote: > > > > > > > > Hi all, > > > > > > > > I display at the top of my page a summary of all error messages. > > > > > > > > In addition I try to mark all incorrect fields with a '*' or another > symbol. > > > > Currently I have no idea how to implement this in an easy way. > > > > > > > > The following simple approach is not working: > > > > <h:inputText id="searchName" value="#{ControllerBean.searchName}" > > required="true"/> > > > > <t:message for="searchName" showDetail="false" > > showSummary="false">*</t:message> > > > > > > > > If I enclose the '*' with a verbatim tag it will be always displayed > (even > > without errors). > > > > > > > > I'am sure this is a common requirement therefore this question. > > > > > > > > Michael > > > > >

